summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitattributes2
-rw-r--r--.gitignore24
-rw-r--r--.gitmodules0
-rw-r--r--INSTALL.md23
-rw-r--r--Makefile59
-rw-r--r--README.md13
-rw-r--r--audio.asm158
-rw-r--r--audio/engine_1.asm331
-rw-r--r--audio/engine_2.asm1765
-rw-r--r--audio/engine_3.asm1580
-rw-r--r--audio/engine_4.asm191
-rw-r--r--[-rwxr-xr-x]audio/headers/musicheaders1.asm0
-rw-r--r--[-rwxr-xr-x]audio/headers/musicheaders2.asm0
-rw-r--r--[-rwxr-xr-x]audio/headers/musicheaders3.asm4
-rw-r--r--audio/headers/musicheaders4.asm11
-rw-r--r--audio/headers/sfxheaders1.asm2
-rw-r--r--audio/headers/sfxheaders2.asm2
-rw-r--r--audio/headers/sfxheaders3.asm2
-rw-r--r--audio/headers/sfxheaders4.asm212
-rw-r--r--audio/music/dungeon1.asm4
-rw-r--r--audio/music/meetjessiejames.asm (renamed from audio/music/yellow/meetjessiejames.asm)1
-rwxr-xr-xaudio/music/printer.asm316
-rw-r--r--audio/music/surfingpikachu.asm (renamed from audio/music/yellow/surfingpikachu.asm)0
-rw-r--r--audio/music/yellowintro.asm (renamed from audio/music/yellow/yellowintro.asm)0
-rw-r--r--audio/music/yellowunusedsong.asm (renamed from audio/music/yellow/yellowunusedsong.asm)0
-rw-r--r--audio/pikachu_cries.asm210
-rw-r--r--audio/pikachu_cries/pikachu_cry_1.wavbin0 -> 18660 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_10.wavbin0 -> 65572 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_11.wavbin0 -> 14628 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_12.wavbin0 -> 27684 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_13.wavbin0 -> 39972 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_14.wavbin0 -> 50404 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_15.wavbin0 -> 42020 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_16.wavbin0 -> 42212 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_17.wavbin0 -> 17188 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_18.wavbin0 -> 30820 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_19.wavbin0 -> 45476 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_2.wavbin0 -> 13860 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_20.wavbin0 -> 65572 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_21.wavbin0 -> 65540 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_22.wavbin0 -> 51492 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_23.wavbin0 -> 30436 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_24.wavbin0 -> 57700 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_25.wavbin0 -> 29156 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_26.wavbin0 -> 27876 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_27.wavbin0 -> 23268 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_28.wavbin0 -> 37476 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_29.wavbin0 -> 24932 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_3.wavbin0 -> 20644 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_30.wavbin0 -> 9636 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_31.wavbin0 -> 15396 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_32.wavbin0 -> 11364 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_33.wavbin0 -> 26020 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_34.wavbin0 -> 43108 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_35.wavbin0 -> 37220 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_36.wavbin0 -> 57124 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_37.wavbin0 -> 28644 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_38.wavbin0 -> 25444 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_39.wavbin0 -> 35940 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_4.wavbin0 -> 32740 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_40.wavbin0 -> 30884 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_41.wavbin0 -> 49380 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_42.wavbin0 -> 44068 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_5.wavbin0 -> 33316 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_6.wavbin0 -> 37028 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_7.wavbin0 -> 28004 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_8.wavbin0 -> 34404 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_9.wavbin0 -> 27172 bytes
-rw-r--r--audio/sfx/get_item1_4.asm47
-rw-r--r--audio/sfx/get_item2_4.asm69
-rw-r--r--audio/sfx/get_item2_4_2.asm69
-rwxr-xr-xaudio/sfx/noise_instrument01_4.asm3
-rwxr-xr-xaudio/sfx/noise_instrument02_4.asm3
-rwxr-xr-xaudio/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/save_3.asm17
-rw-r--r--audio/sfx/shooting_star.asm2
-rw-r--r--audio/sfx/surfing_add_points.asm7
-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
-rwxr-xr-xaudio/sfx/tink_4.asm8
-rwxr-xr-xaudio/sfx/unknown_80263.asm4
-rw-r--r--audio/sfx/unknown_8026a.asm9
-rw-r--r--audio/sfx/unknown_8027f.asm7
-rwxr-xr-xaudio/sfx/unknown_802cc.asm5
-rw-r--r--audio/sfx/unknown_80337.asm31
-rw-r--r--audio/sfx/unknown_80383.asm35
-rw-r--r--audio/sfx/unknown_803da.asm25
-rw-r--r--audio/sfx/unknown_80411.asm33
-rw-r--r--audio/sfx/unknown_80467.asm34
-rw-r--r--audio/sfx/unknown_804bf.asm26
-rw-r--r--audio/sfx/unknown_804fa.asm30
-rw-r--r--audio/sfx/unknown_80545.asm29
-rw-r--r--audio/sfx/unknown_8058b.asm31
-rw-r--r--audio/sfx/unknown_805db.asm21
-rw-r--r--audio/sfx/unknown_80603.asm23
-rw-r--r--audio/sfx/unknown_80633.asm22
-rw-r--r--audio/sfx/unknown_80661.asm21
-rw-r--r--audio/sfx/unknown_80689.asm19
-rw-r--r--audio/sfx/unknown_806af.asm37
-rw-r--r--audio/sfx/unknown_80712.asm29
-rw-r--r--audio/sfx/unknown_80760.asm17
-rw-r--r--audio/sfx/unknown_8077e.asm40
-rw-r--r--audio/sfx/unknown_807eb.asm24
-rw-r--r--audio/sfx/unknown_8081e.asm35
-rw-r--r--audio/sfx/unknown_80879.asm23
-rw-r--r--audio/sfx/unknown_808a9.asm32
-rw-r--r--audio/sfx/unknown_808fa.asm18
-rw-r--r--audio/sfx/unknown_8091c.asm21
-rw-r--r--audio/sfx/unknown_80944.asm26
-rw-r--r--audio/sfx/unknown_8097f.asm24
-rw-r--r--audio/sfx/unknown_809b2.asm30
-rw-r--r--audio/sfx/unknown_809fb.asm21
-rw-r--r--audio/sfx/unknown_80a23.asm38
-rw-r--r--audio/sfx/unknown_80a89.asm30
-rw-r--r--audio/sfx/unknown_80ad2.asm24
-rw-r--r--audio/sfx/unknown_80b05.asm31
-rw-r--r--audio/sfx/unknown_80b53.asm30
-rw-r--r--audio/sfx/unknown_80b9c.asm29
-rw-r--r--audio/sfx/unknown_80be2.asm34
-rw-r--r--audio/sfx/unknown_80c3b.asm24
-rw-r--r--audio/sfx/unknown_80c6e.asm24
-rw-r--r--audio/sfx/unknown_80ca1.asm27
-rw-r--r--audio/sfx/unknown_80ce7.asm24
-rw-r--r--audio/sfx/unknown_80e91.asm47
-rwxr-xr-xaudio/unknown_832b9.binbin0 -> 3398 bytes
-rw-r--r--audio/wave_instruments.asm2
-rw-r--r--constants.asm1
-rw-r--r--constants/credits_constants.asm160
-rw-r--r--[-rwxr-xr-x]constants/event_constants.asm16
-rwxr-xr-xconstants/hide_show_constants.asm381
-rw-r--r--constants/map_constants.asm1
-rw-r--r--constants/misc_constants.asm30
-rw-r--r--constants/music_constants.asm23
-rwxr-xr-xconstants/oam_constants.asm15
-rwxr-xr-xconstants/palette_constants.asm3
-rw-r--r--constants/pikachu_emotion_constants.asm224
-rwxr-xr-xconstants/sprite_constants.asm66
-rwxr-xr-x[-rw-r--r--]constants/text_constants.asm1
-rw-r--r--constants/tilesets.asm1
-rwxr-xr-xconstants/trainer_constants.asm94
-rwxr-xr-xdata/animated_objects_3e_1.asm383
-rwxr-xr-xdata/animated_objects_3e_2.asm236
-rwxr-xr-xdata/animations.asm5
-rw-r--r--data/baseStats/abra.asm2
-rw-r--r--data/baseStats/aerodactyl.asm2
-rw-r--r--data/baseStats/alakazam.asm6
-rw-r--r--data/baseStats/arbok.asm2
-rw-r--r--data/baseStats/arcanine.asm2
-rw-r--r--data/baseStats/articuno.asm2
-rw-r--r--data/baseStats/beedrill.asm2
-rw-r--r--data/baseStats/bellsprout.asm2
-rw-r--r--data/baseStats/blastoise.asm2
-rw-r--r--data/baseStats/bulbasaur.asm2
-rw-r--r--data/baseStats/butterfree.asm4
-rw-r--r--data/baseStats/caterpie.asm2
-rw-r--r--data/baseStats/chansey.asm4
-rw-r--r--data/baseStats/charizard.asm4
-rw-r--r--data/baseStats/charmander.asm2
-rw-r--r--data/baseStats/charmeleon.asm2
-rw-r--r--data/baseStats/clefable.asm2
-rw-r--r--data/baseStats/clefairy.asm2
-rw-r--r--data/baseStats/cloyster.asm2
-rw-r--r--data/baseStats/cubone.asm4
-rw-r--r--data/baseStats/dewgong.asm2
-rw-r--r--data/baseStats/diglett.asm4
-rw-r--r--data/baseStats/ditto.asm2
-rw-r--r--data/baseStats/dodrio.asm2
-rw-r--r--data/baseStats/doduo.asm2
-rw-r--r--data/baseStats/dragonair.asm4
-rw-r--r--data/baseStats/dragonite.asm4
-rw-r--r--data/baseStats/dratini.asm2
-rw-r--r--data/baseStats/drowzee.asm2
-rw-r--r--data/baseStats/dugtrio.asm4
-rw-r--r--data/baseStats/eevee.asm4
-rw-r--r--data/baseStats/ekans.asm2
-rw-r--r--data/baseStats/electabuzz.asm2
-rw-r--r--data/baseStats/electrode.asm2
-rw-r--r--data/baseStats/exeggcute.asm2
-rw-r--r--data/baseStats/exeggutor.asm2
-rw-r--r--data/baseStats/farfetchd.asm2
-rw-r--r--data/baseStats/fearow.asm2
-rw-r--r--data/baseStats/flareon.asm4
-rw-r--r--data/baseStats/gastly.asm2
-rw-r--r--data/baseStats/gengar.asm2
-rw-r--r--data/baseStats/geodude.asm2
-rw-r--r--data/baseStats/gloom.asm2
-rw-r--r--data/baseStats/golbat.asm2
-rw-r--r--data/baseStats/goldeen.asm2
-rw-r--r--data/baseStats/golduck.asm2
-rw-r--r--data/baseStats/golem.asm2
-rw-r--r--data/baseStats/graveler.asm2
-rw-r--r--data/baseStats/grimer.asm2
-rw-r--r--data/baseStats/growlithe.asm2
-rw-r--r--data/baseStats/gyarados.asm10
-rw-r--r--data/baseStats/haunter.asm2
-rw-r--r--data/baseStats/hitmonchan.asm2
-rw-r--r--data/baseStats/hitmonlee.asm2
-rw-r--r--data/baseStats/horsea.asm2
-rw-r--r--data/baseStats/hypno.asm2
-rw-r--r--data/baseStats/ivysaur.asm2
-rw-r--r--data/baseStats/jigglypuff.asm2
-rw-r--r--data/baseStats/jolteon.asm4
-rw-r--r--data/baseStats/jynx.asm2
-rw-r--r--data/baseStats/kabuto.asm2
-rw-r--r--data/baseStats/kabutops.asm4
-rw-r--r--data/baseStats/kadabra.asm6
-rw-r--r--data/baseStats/kakuna.asm2
-rw-r--r--data/baseStats/kangaskhan.asm2
-rw-r--r--data/baseStats/kingler.asm2
-rw-r--r--data/baseStats/koffing.asm2
-rw-r--r--data/baseStats/krabby.asm2
-rw-r--r--data/baseStats/lapras.asm2
-rw-r--r--data/baseStats/lickitung.asm2
-rw-r--r--data/baseStats/machamp.asm2
-rw-r--r--data/baseStats/machoke.asm2
-rw-r--r--data/baseStats/machop.asm2
-rw-r--r--data/baseStats/magikarp.asm2
-rw-r--r--data/baseStats/magmar.asm2
-rw-r--r--data/baseStats/magnemite.asm2
-rw-r--r--data/baseStats/magneton.asm2
-rw-r--r--data/baseStats/mankey.asm2
-rw-r--r--data/baseStats/marowak.asm8
-rw-r--r--data/baseStats/meowth.asm2
-rw-r--r--data/baseStats/metapod.asm2
-rw-r--r--data/baseStats/mew.asm7
-rw-r--r--data/baseStats/mewtwo.asm4
-rw-r--r--data/baseStats/moltres.asm2
-rw-r--r--data/baseStats/mrmime.asm2
-rw-r--r--data/baseStats/muk.asm2
-rw-r--r--data/baseStats/nidoking.asm2
-rw-r--r--data/baseStats/nidoqueen.asm2
-rw-r--r--data/baseStats/nidoranf.asm2
-rw-r--r--data/baseStats/nidoranm.asm2
-rw-r--r--data/baseStats/nidorina.asm2
-rw-r--r--data/baseStats/nidorino.asm2
-rw-r--r--data/baseStats/ninetales.asm2
-rw-r--r--data/baseStats/oddish.asm2
-rw-r--r--data/baseStats/omanyte.asm2
-rw-r--r--data/baseStats/omastar.asm2
-rw-r--r--data/baseStats/onix.asm2
-rw-r--r--data/baseStats/paras.asm2
-rw-r--r--data/baseStats/parasect.asm2
-rw-r--r--data/baseStats/persian.asm2
-rw-r--r--data/baseStats/pidgeot.asm2
-rw-r--r--data/baseStats/pidgeotto.asm2
-rw-r--r--data/baseStats/pidgey.asm2
-rw-r--r--data/baseStats/pikachu.asm2
-rw-r--r--data/baseStats/pinsir.asm2
-rw-r--r--data/baseStats/poliwag.asm2
-rw-r--r--data/baseStats/poliwhirl.asm2
-rw-r--r--data/baseStats/poliwrath.asm2
-rw-r--r--data/baseStats/ponyta.asm2
-rw-r--r--data/baseStats/porygon.asm2
-rw-r--r--data/baseStats/primeape.asm4
-rw-r--r--data/baseStats/psyduck.asm2
-rw-r--r--data/baseStats/raichu.asm2
-rw-r--r--data/baseStats/rapidash.asm2
-rw-r--r--data/baseStats/raticate.asm2
-rw-r--r--data/baseStats/rattata.asm2
-rw-r--r--data/baseStats/rhydon.asm2
-rw-r--r--data/baseStats/rhyhorn.asm2
-rw-r--r--data/baseStats/sandshrew.asm2
-rw-r--r--data/baseStats/sandslash.asm2
-rw-r--r--data/baseStats/scyther.asm2
-rw-r--r--data/baseStats/seadra.asm2
-rw-r--r--data/baseStats/seaking.asm2
-rw-r--r--data/baseStats/seel.asm2
-rw-r--r--data/baseStats/shellder.asm2
-rw-r--r--data/baseStats/slowbro.asm2
-rw-r--r--data/baseStats/slowpoke.asm2
-rw-r--r--data/baseStats/snorlax.asm2
-rw-r--r--data/baseStats/spearow.asm2
-rw-r--r--data/baseStats/squirtle.asm2
-rw-r--r--data/baseStats/starmie.asm2
-rw-r--r--data/baseStats/staryu.asm2
-rw-r--r--data/baseStats/tangela.asm4
-rw-r--r--data/baseStats/tauros.asm2
-rw-r--r--data/baseStats/tentacool.asm2
-rw-r--r--data/baseStats/tentacruel.asm2
-rw-r--r--data/baseStats/vaporeon.asm4
-rw-r--r--data/baseStats/venomoth.asm8
-rw-r--r--data/baseStats/venonat.asm4
-rw-r--r--data/baseStats/venusaur.asm2
-rw-r--r--data/baseStats/victreebel.asm2
-rw-r--r--data/baseStats/vileplume.asm2
-rw-r--r--data/baseStats/voltorb.asm2
-rw-r--r--data/baseStats/vulpix.asm2
-rw-r--r--data/baseStats/wartortle.asm2
-rw-r--r--data/baseStats/weedle.asm2
-rw-r--r--data/baseStats/weepinbell.asm2
-rw-r--r--data/baseStats/weezing.asm2
-rw-r--r--data/baseStats/wigglytuff.asm2
-rw-r--r--data/baseStats/zapdos.asm2
-rw-r--r--data/baseStats/zubat.asm2
-rwxr-xr-xdata/base_stats.asm1
-rw-r--r--data/bg_map_attributes.asm506
-rw-r--r--data/collision.asm1
-rwxr-xr-xdata/credit_mons.asm4
-rwxr-xr-xdata/credits_order.asm69
-rwxr-xr-xdata/evos_moves.asm157
-rw-r--r--data/facing.asm174
-rwxr-xr-xdata/hidden_item_coords.asm73
-rwxr-xr-xdata/hidden_objects.asm1344
-rwxr-xr-xdata/hide_show_data.asm44
-rw-r--r--data/mapHeaders/BeachHouse.asm8
-rw-r--r--data/mapObjects/BeachHouse.asm20
-rwxr-xr-xdata/mapObjects/BluesHouse.asm2
-rwxr-xr-xdata/mapObjects/CeladonMart3F.asm6
-rwxr-xr-xdata/mapObjects/CeladonPokecenter.asm5
-rwxr-xr-xdata/mapObjects/CeruleanCave1F.asm9
-rwxr-xr-xdata/mapObjects/CeruleanCave2F.asm9
-rwxr-xr-xdata/mapObjects/CeruleanCaveB1F.asm8
-rwxr-xr-xdata/mapObjects/CeruleanCity.asm8
-rwxr-xr-xdata/mapObjects/CeruleanPokecenter.asm5
-rwxr-xr-xdata/mapObjects/CeruleanTradeHouse.asm8
-rwxr-xr-xdata/mapObjects/CinnabarGym.asm2
-rwxr-xr-xdata/mapObjects/CinnabarPokecenter.asm3
-rw-r--r--[-rwxr-xr-x]data/mapObjects/Colosseum.asm0
-rwxr-xr-xdata/mapObjects/CopycatsHouse1F.asm2
-rwxr-xr-xdata/mapObjects/FuchsiaCity.asm2
-rwxr-xr-xdata/mapObjects/FuchsiaGym.asm2
-rwxr-xr-xdata/mapObjects/FuchsiaPokecenter.asm5
-rwxr-xr-xdata/mapObjects/GameCorner.asm4
-rwxr-xr-xdata/mapObjects/IndigoPlateauLobby.asm3
-rwxr-xr-xdata/mapObjects/LavenderPokecenter.asm5
-rwxr-xr-xdata/mapObjects/MtMoonB2F.asm15
-rwxr-xr-xdata/mapObjects/MtMoonPokecenter.asm3
-rwxr-xr-xdata/mapObjects/OaksLab.asm20
-rwxr-xr-xdata/mapObjects/PalletTown.asm2
-rwxr-xr-xdata/mapObjects/PewterPokecenter.asm6
-rwxr-xr-xdata/mapObjects/PokemonFanClub.asm6
-rwxr-xr-xdata/mapObjects/PokemonTower7F.asm9
-rwxr-xr-xdata/mapObjects/RockTunnelPokecenter.asm5
-rwxr-xr-xdata/mapObjects/RocketHideoutB4F.asm4
-rwxr-xr-xdata/mapObjects/Route11.asm4
-rwxr-xr-xdata/mapObjects/Route12.asm2
-rwxr-xr-xdata/mapObjects/Route15.asm4
-rwxr-xr-xdata/mapObjects/Route16.asm8
-rwxr-xr-xdata/mapObjects/Route18.asm4
-rwxr-xr-xdata/mapObjects/Route18Gate2F.asm2
-rwxr-xr-xdata/mapObjects/Route19.asm12
-rwxr-xr-xdata/mapObjects/Route2.asm7
-rwxr-xr-xdata/mapObjects/Route22Gate.asm2
-rwxr-xr-xdata/mapObjects/Route24.asm3
-rwxr-xr-xdata/mapObjects/Route2TradeHouse.asm2
-rwxr-xr-xdata/mapObjects/Route5.asm2
-rwxr-xr-xdata/mapObjects/Route6.asm4
-rwxr-xr-xdata/mapObjects/Route7.asm4
-rwxr-xr-xdata/mapObjects/Route7Gate.asm2
-rwxr-xr-xdata/mapObjects/Route8.asm4
-rwxr-xr-xdata/mapObjects/Route8Gate.asm4
-rwxr-xr-xdata/mapObjects/Route9.asm2
-rwxr-xr-xdata/mapObjects/SSAnne1FRooms.asm2
-rwxr-xr-xdata/mapObjects/SaffronCity.asm3
-rwxr-xr-xdata/mapObjects/SaffronGym.asm2
-rwxr-xr-xdata/mapObjects/SaffronPokecenter.asm3
-rwxr-xr-xdata/mapObjects/SeafoamIslands1F.asm4
-rwxr-xr-xdata/mapObjects/SilphCo11F.asm5
-rw-r--r--[-rwxr-xr-x]data/mapObjects/TradeCenter.asm0
-rwxr-xr-xdata/mapObjects/VermilionCity.asm19
-rwxr-xr-xdata/mapObjects/VermilionPokecenter.asm3
-rwxr-xr-xdata/mapObjects/VermilionTradeHouse.asm2
-rwxr-xr-xdata/mapObjects/ViridianCity.asm15
-rwxr-xr-xdata/mapObjects/ViridianForest.asm26
-rwxr-xr-xdata/mapObjects/ViridianForestSouthGate.asm2
-rwxr-xr-xdata/mapObjects/ViridianPokecenter.asm5
-rwxr-xr-xdata/mapObjects/ViridianSchoolHouse.asm3
-rw-r--r--[-rwxr-xr-x]data/map_header_banks.asm1
-rw-r--r--[-rwxr-xr-x]data/map_header_pointers.asm1
-rw-r--r--[-rwxr-xr-x]data/map_songs.asm1
-rwxr-xr-xdata/mart_inventories.asm30
-rwxr-xr-xdata/mon_party_sprites.asm152
-rwxr-xr-xdata/pikachu_emotions.asm266
-rwxr-xr-xdata/pikachu_pic_animation.asm399
-rwxr-xr-xdata/pikachu_pic_objects.asm300
-rwxr-xr-xdata/pikachu_pic_tilemaps.asm253
-rwxr-xr-xdata/pokedex_entries.asm1432
-rwxr-xr-xdata/prize_mon_levels.asm21
-rwxr-xr-xdata/prizes.asm41
-rwxr-xr-xdata/sgb_border.asm137
-rwxr-xr-xdata/sgb_packets.asm119
-rwxr-xr-xdata/sprite_sets.asm96
-rwxr-xr-xdata/super_palettes.asm653
-rwxr-xr-xdata/super_rod.asm133
-rwxr-xr-xdata/tileset_headers.asm2
-rwxr-xr-xdata/title_mons.asm56
-rwxr-xr-xdata/tms.asm1
-rwxr-xr-xdata/town_map_entries.asm1
-rwxr-xr-xdata/trades.asm20
-rwxr-xr-xdata/trainer_moves.asm192
-rwxr-xr-xdata/trainer_parties.asm105
-rwxr-xr-xdata/warp_tile_ids.asm4
-rw-r--r--data/wildPokemon/ceruleancave1.asm26
-rw-r--r--data/wildPokemon/ceruleancave2.asm19
-rw-r--r--data/wildPokemon/ceruleancaveb1.asm24
-rwxr-xr-xdata/wildPokemon/diglettscave.asm1
-rwxr-xr-xdata/wildPokemon/mansion1.asm35
-rwxr-xr-xdata/wildPokemon/mansion2.asm35
-rwxr-xr-xdata/wildPokemon/mansion3.asm35
-rwxr-xr-xdata/wildPokemon/mansionb1.asm34
-rwxr-xr-xdata/wildPokemon/mtmoon1.asm9
-rwxr-xr-xdata/wildPokemon/mtmoonb1.asm13
-rwxr-xr-xdata/wildPokemon/mtmoonb2.asm15
-rwxr-xr-xdata/wildPokemon/nomons.asm1
-rwxr-xr-xdata/wildPokemon/pokemontower1.asm1
-rwxr-xr-xdata/wildPokemon/pokemontower2.asm1
-rwxr-xr-xdata/wildPokemon/pokemontower3.asm7
-rwxr-xr-xdata/wildPokemon/pokemontower4.asm7
-rwxr-xr-xdata/wildPokemon/pokemontower5.asm17
-rwxr-xr-xdata/wildPokemon/pokemontower6.asm13
-rwxr-xr-xdata/wildPokemon/pokemontower7.asm19
-rwxr-xr-xdata/wildPokemon/powerplant.asm26
-rwxr-xr-xdata/wildPokemon/rocktunnel1.asm17
-rwxr-xr-xdata/wildPokemon/rocktunnel2.asm19
-rwxr-xr-xdata/wildPokemon/route1.asm11
-rwxr-xr-xdata/wildPokemon/route10.asm35
-rwxr-xr-xdata/wildPokemon/route11.asm35
-rwxr-xr-xdata/wildPokemon/route12.asm48
-rwxr-xr-xdata/wildPokemon/route13.asm51
-rwxr-xr-xdata/wildPokemon/route14.asm35
-rwxr-xr-xdata/wildPokemon/route15.asm35
-rwxr-xr-xdata/wildPokemon/route16.asm15
-rwxr-xr-xdata/wildPokemon/route17.asm17
-rwxr-xr-xdata/wildPokemon/route18.asm15
-rw-r--r--[-rwxr-xr-x]data/wildPokemon/route19.asm (renamed from data/wildPokemon/waterpokemon.asm)4
-rwxr-xr-xdata/wildPokemon/route2.asm24
-rw-r--r--data/wildPokemon/route20.asm15
-rwxr-xr-xdata/wildPokemon/route21.asm22
-rwxr-xr-xdata/wildPokemon/route22.asm35
-rwxr-xr-xdata/wildPokemon/route23.asm31
-rwxr-xr-xdata/wildPokemon/route24.asm35
-rwxr-xr-xdata/wildPokemon/route25.asm35
-rwxr-xr-xdata/wildPokemon/route3.asm19
-rwxr-xr-xdata/wildPokemon/route4.asm35
-rwxr-xr-xdata/wildPokemon/route5.asm35
-rwxr-xr-xdata/wildPokemon/route6.asm48
-rwxr-xr-xdata/wildPokemon/route7.asm35
-rwxr-xr-xdata/wildPokemon/route8.asm35
-rwxr-xr-xdata/wildPokemon/route9.asm35
-rwxr-xr-xdata/wildPokemon/safarizone1.asm35
-rwxr-xr-xdata/wildPokemon/safarizone2.asm36
-rwxr-xr-xdata/wildPokemon/safarizone3.asm35
-rwxr-xr-xdata/wildPokemon/safarizonecenter.asm35
-rwxr-xr-xdata/wildPokemon/seafoamisland1.asm35
-rwxr-xr-xdata/wildPokemon/seafoamislandb1.asm35
-rwxr-xr-xdata/wildPokemon/seafoamislandb2.asm35
-rwxr-xr-xdata/wildPokemon/seafoamislandb3.asm48
-rwxr-xr-xdata/wildPokemon/seafoamislandb4.asm48
-rwxr-xr-xdata/wildPokemon/victoryroad1.asm17
-rwxr-xr-xdata/wildPokemon/victoryroad2.asm21
-rwxr-xr-xdata/wildPokemon/victoryroad3.asm17
-rwxr-xr-xdata/wildPokemon/viridianforest.asm35
-rwxr-xr-xdata/wild_mons.asm8
-rw-r--r--docs/bugs_and_glitches.md59
-rwxr-xr-xengine/HoF_room_pc.asm283
-rw-r--r--engine/add_mon.asm6
-rwxr-xr-xengine/animated_objects_3e.asm394
-rw-r--r--engine/bank30.binbin0 -> 16384 bytes
-rw-r--r--engine/bank3c.asm189
-rw-r--r--engine/bank3d.asm495
-rw-r--r--engine/bank3e.asm5
-rw-r--r--engine/bank3f.asm23
-rwxr-xr-xengine/battle/animations.asm766
-rw-r--r--engine/battle/bank3d_battle.asm291
-rwxr-xr-xengine/battle/bank_e_misc.asm19
-rw-r--r--engine/battle/battle_transitions.asm8
-rw-r--r--engine/battle/common_text.asm16
-rwxr-xr-xengine/battle/core.asm710
-rw-r--r--engine/battle/draw_hud_pokeball_gfx.asm10
-rwxr-xr-xengine/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/link_battle_versus_text.asm3
-rw-r--r--engine/battle/moveEffects/heal_effect.asm6
-rw-r--r--engine/battle/moveEffects/reflect_light_screen_effect.asm6
-rw-r--r--engine/battle/moveEffects/transform_effect.asm11
-rwxr-xr-xengine/battle/read_trainer_party.asm103
-rwxr-xr-xengine/battle/safari_zone.asm10
-rw-r--r--engine/battle/scale_sprites.asm7
-rw-r--r--engine/battle/trainer_ai.asm37
-rw-r--r--engine/battle/wild_encounters.asm7
-rw-r--r--engine/bcd.asm62
-rw-r--r--engine/bg_map_attributes.asm219
-rw-r--r--engine/black_out.asm2
-rwxr-xr-xengine/cable_club.asm61
-rwxr-xr-xengine/clear_save.asm4
-rw-r--r--engine/debug1.asm25
-rwxr-xr-xengine/diploma_3a.asm166
-rw-r--r--engine/display_text_id_init.asm9
-rwxr-xr-xengine/evolution.asm8
-rwxr-xr-xengine/evolve_trade.asm44
-rwxr-xr-xengine/evos_moves.asm219
-rwxr-xr-xengine/gamefreak.asm50
-rwxr-xr-xengine/give_pokemon.asm5
-rwxr-xr-xengine/hall_of_fame.asm37
-rwxr-xr-xengine/hidden_object_functions14.asm2
-rwxr-xr-xengine/hidden_object_functions17.asm111
-rwxr-xr-xengine/hidden_object_functions18.asm52
-rwxr-xr-xengine/hidden_object_functions3.asm2
-rwxr-xr-xengine/hidden_object_functions7.asm75
-rwxr-xr-xengine/hp_bar.asm8
-rwxr-xr-xengine/in_game_trades.asm58
-rw-r--r--engine/init_player_data.asm5
-rwxr-xr-xengine/intro.asm354
-rw-r--r--engine/items/inventory.asm9
-rwxr-xr-xengine/items/items.asm588
-rwxr-xr-xengine/items/tms.asm6
-rw-r--r--engine/joypad.asm38
-rwxr-xr-xengine/learn_move.asm42
-rw-r--r--engine/load_mon_data.asm21
-rw-r--r--engine/menu/bills_pc.asm90
-rw-r--r--[-rwxr-xr-x]engine/menu/diploma.asm100
-rw-r--r--engine/menu/draw_start_menu.asm10
-rwxr-xr-xengine/menu/league_pc.asm5
-rw-r--r--engine/menu/link_menu.asm910
-rwxr-xr-xengine/menu/main_menu.asm451
-rwxr-xr-xengine/menu/naming_screen.asm30
-rw-r--r--engine/menu/options.asm443
-rwxr-xr-xengine/menu/party_menu.asm22
-rwxr-xr-xengine/menu/players_pc.asm7
-rwxr-xr-xengine/menu/pokedex.asm362
-rwxr-xr-xengine/menu/prize_menu.asm9
-rwxr-xr-xengine/menu/start_menu.asm5
-rwxr-xr-xengine/menu/start_sub_menus.asm39
-rwxr-xr-xengine/menu/status_screen.asm28
-rw-r--r--engine/menu/text_box.asm36
-rwxr-xr-xengine/menu/vending_machine.asm3
-rwxr-xr-xengine/mon_party_sprites.asm30
-rwxr-xr-xengine/multiply_divide.asm65
-rwxr-xr-xengine/oak_speech.asm43
-rwxr-xr-xengine/oak_speech2.asm43
-rw-r--r--engine/overworld/advance_player_sprite.asm241
-rwxr-xr-xengine/overworld/cable_club_npc.asm59
-rwxr-xr-xengine/overworld/card_key.asm11
-rwxr-xr-xengine/overworld/cut.asm7
-rwxr-xr-xengine/overworld/cut2.asm2
-rwxr-xr-xengine/overworld/doors.asm4
-rw-r--r--engine/overworld/dungeon_warps.asm15
-rwxr-xr-xengine/overworld/elevator.asm6
-rwxr-xr-xengine/overworld/emotion_bubbles.asm18
-rw-r--r--engine/overworld/field_move_messages.asm4
-rwxr-xr-xengine/overworld/healing_machine.asm27
-rwxr-xr-xengine/overworld/hidden_items.asm17
-rwxr-xr-xengine/overworld/hidden_objects.asm42
-rwxr-xr-xengine/overworld/ledges.asm18
-rw-r--r--engine/overworld/map_sprite_functions1.asm48
-rwxr-xr-xengine/overworld/map_sprites.asm595
-rw-r--r--engine/overworld/missable_objects.asm19
-rw-r--r--engine/overworld/movement.asm401
-rwxr-xr-xengine/overworld/npc_movement.asm52
-rwxr-xr-xengine/overworld/npc_movement_2.asm24
-rw-r--r--engine/overworld/oam.asm163
-rwxr-xr-xengine/overworld/player_animations.asm26
-rw-r--r--engine/overworld/player_state.asm29
-rw-r--r--engine/overworld/poison.asm41
-rwxr-xr-xengine/overworld/pokecenter.asm101
-rw-r--r--engine/overworld/push_boulder.asm4
-rwxr-xr-xengine/overworld/ssanne.asm4
-rw-r--r--engine/overworld/tileset_header.asm21
-rwxr-xr-xengine/palettes.asm583
-rw-r--r--engine/pathfinding.asm8
-rwxr-xr-xengine/pikachu_emotions.asm421
-rwxr-xr-xengine/pikachu_follow.asm1578
-rwxr-xr-xengine/pikachu_movement.asm1048
-rwxr-xr-xengine/pikachu_pcm.asm154
-rwxr-xr-xengine/pikachu_pic_animation.asm851
-rwxr-xr-xengine/pikachu_status.asm258
-rwxr-xr-xengine/pokedex_rating.asm102
-rwxr-xr-xengine/predefs.asm28
-rwxr-xr-xengine/predefs7.asm6
-rw-r--r--[-rwxr-xr-x]engine/predefsA.asm (renamed from engine/predefs12.asm)10
-rw-r--r--engine/print_waiting_text.asm11
-rw-r--r--engine/printer.asm999
-rwxr-xr-xengine/printer/serial.asm621
-rw-r--r--engine/remove_pokemon.asm66
-rwxr-xr-xengine/save.asm172
-rwxr-xr-xengine/slot_machine.asm21
-rwxr-xr-xengine/surfing_minigame.asm2862
-rwxr-xr-xengine/titlescreen.asm455
-rwxr-xr-xengine/titlescreen2.asm4
-rwxr-xr-xengine/town_map.asm23
-rwxr-xr-xengine/trade.asm28
-rwxr-xr-xengine/turn_sprite.asm25
-rwxr-xr-xengine/unknown_ea3ea.asm973
-rwxr-xr-xengine/vermilion_gym_trash_cans.asm108
-rwxr-xr-xengine/yellow_intro.asm1081
-rw-r--r--gfx/9_tile.pngbin0 -> 86 bytes
-rw-r--r--gfx/badges.pngbin924 -> 919 bytes
-rw-r--r--gfx/blocksets/beachhouse.bstbin0 -> 320 bytes
-rw-r--r--gfx/blocksets/gym.bstbin1856 -> 1856 bytes
-rw-r--r--gfx/blocksets/plateau.bstbin1200 -> 1168 bytes
-rw-r--r--gfx/blocksets/pokecenter.bstbin592 -> 640 bytes
-rw-r--r--gfx/blue/intro_purin_1.pngbin366 -> 0 bytes
-rw-r--r--gfx/blue/intro_purin_2.pngbin360 -> 0 bytes
-rw-r--r--gfx/blue/intro_purin_3.pngbin416 -> 0 bytes
-rw-r--r--gfx/blue/sgbborder.mapbin1792 -> 0 bytes
-rw-r--r--gfx/blue/sgbborder.pngbin1117 -> 0 bytes
-rw-r--r--gfx/blue/slotmachine1.pngbin459 -> 0 bytes
-rw-r--r--gfx/blue/slotmachine2.pngbin314 -> 0 bytes
-rw-r--r--gfx/blueversion.png (renamed from gfx/blue/blueversion.png)bin116 -> 116 bytes
-rw-r--r--gfx/copyright.pngbin220 -> 219 bytes
-rw-r--r--gfx/emotion_bubbles.pngbin149 -> 269 bytes
-rw-r--r--gfx/intro_fight.pngbin1099 -> 0 bytes
-rw-r--r--gfx/ledge_hopping_shadow.pngbin77 -> 84 bytes
-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/pokemon_logo.pngbin926 -> 1793 bytes
-rw-r--r--gfx/pokemon_logo_japan.pngbin0 -> 1991 bytes
-rw-r--r--gfx/pokemon_yellow.pngbin0 -> 781 bytes
-rw-r--r--gfx/red/intro_nido_1.pngbin462 -> 0 bytes
-rw-r--r--gfx/red/intro_nido_2.pngbin449 -> 0 bytes
-rw-r--r--gfx/red/intro_nido_3.pngbin495 -> 0 bytes
-rw-r--r--gfx/red/redgreenversion.pngbin126 -> 0 bytes
-rw-r--r--gfx/red/sgbborder.mapbin1792 -> 0 bytes
-rw-r--r--gfx/red/sgbborder.pngbin1048 -> 0 bytes
-rw-r--r--gfx/red/slotmachine1.pngbin471 -> 0 bytes
-rw-r--r--gfx/red/slotmachine2.pngbin346 -> 0 bytes
-rw-r--r--gfx/slotmachine1.png (renamed from gfx/yellow/slotmachine1.png)bin470 -> 470 bytes
-rw-r--r--gfx/slotmachine2.png (renamed from gfx/yellow/slotmachine2.png)bin379 -> 379 bytes
-rw-r--r--gfx/sprites/bike_shop_guy.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/clefairy2.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/mom_geisha.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/stats_screen_hp.pngbin0 -> 82 bytes
-rw-r--r--gfx/stats_screen_lv.pngbin0 -> 78 bytes
-rw-r--r--gfx/surfing_pikachu_1.pngbin0 -> 3766 bytes
-rw-r--r--gfx/surfing_pikachu_1a.pngbin0 -> 638 bytes
-rw-r--r--gfx/surfing_pikachu_1b.pngbin0 -> 2002 bytes
-rw-r--r--gfx/surfing_pikachu_1c.pngbin0 -> 1318 bytes
-rw-r--r--gfx/surfing_pikachu_2.pngbin0 -> 816 bytes
-rw-r--r--gfx/surfing_pikachu_3.pngbin0 -> 2783 bytes
-rw-r--r--gfx/tilemaps/sgbborder.mapbin0 -> 1792 bytes
-rw-r--r--gfx/tilesets/beachhouse.pngbin0 -> 566 bytes
-rw-r--r--gfx/tilesets/beachhouse.tilecoll1
-rw-r--r--gfx/tilesets/overworld.pngbin1309 -> 1304 bytes
-rw-r--r--gfx/unknown_f8946.map1
-rw-r--r--gfx/unknown_f90bc.mapbin0 -> 240 bytes
-rw-r--r--gfx/unknown_f91ac.map1
-rw-r--r--gfx/unknown_f91bb.map2
-rw-r--r--gfx/unknown_f91c8.map1
-rw-r--r--gfx/unknown_f9b6e.mapbin0 -> 120 bytes
-rw-r--r--gfx/unknown_f9be6.map1
-rw-r--r--gfx/unknown_f9bf2.map1
-rw-r--r--gfx/unknown_f9c2c.pngbin0 -> 120 bytes
-rw-r--r--gfx/unknown_f9c6c.pngbin0 -> 117 bytes
-rw-r--r--gfx/unknown_fd86b.pngbin0 -> 92 bytes
-rw-r--r--gfx/yellow_intro.pngbin0 -> 2711 bytes
-rw-r--r--gfx/yellow_titlescreen.pngbin0 -> 1017 bytes
-rw-r--r--gfx/zero_one_ea597.pngbin0 -> 92 bytes
-rw-r--r--home.asm926
-rw-r--r--home/audio.asm184
-rw-r--r--home/copy.asm70
-rw-r--r--home/copy2.asm136
-rw-r--r--home/fade.asm11
-rw-r--r--home/init.asm9
-rw-r--r--home/joypad.asm39
-rw-r--r--home/lcdc.asm20
-rw-r--r--home/overworld.asm1251
-rw-r--r--home/pic.asm13
-rwxr-xr-xhome/pikachu.asm114
-rw-r--r--[-rwxr-xr-x]home/play_time.asm (renamed from engine/play_time.asm)22
-rw-r--r--home/predef.asm6
-rw-r--r--home/serial.asm11
-rw-r--r--home/text.asm27
-rw-r--r--home/vblank.asm37
-rw-r--r--home/vcopy.asm66
-rw-r--r--hram.asm23
-rw-r--r--macros.asm102
-rwxr-xr-xmacros/asm_macros.asm6
-rwxr-xr-xmacros/audio_macros.asm8
-rw-r--r--[-rwxr-xr-x]macros/event_macros.asm61
-rwxr-xr-xmain.asm704
-rw-r--r--maps/BeachHouse.blk1
-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
-rwxr-xr-xmaps/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--pic/bmon/abra.pngbin390 -> 0 bytes
-rw-r--r--pic/bmon/aerodactyl.pngbin583 -> 0 bytes
-rw-r--r--pic/bmon/alakazam.pngbin688 -> 0 bytes
-rw-r--r--pic/bmon/arbok.pngbin728 -> 0 bytes
-rw-r--r--pic/bmon/arcanine.pngbin722 -> 0 bytes
-rw-r--r--pic/bmon/articuno.pngbin705 -> 0 bytes
-rw-r--r--pic/bmon/beedrill.pngbin666 -> 0 bytes
-rw-r--r--pic/bmon/bellsprout.pngbin313 -> 0 bytes
-rw-r--r--pic/bmon/blastoise.pngbin685 -> 0 bytes
-rw-r--r--pic/bmon/bulbasaur.pngbin362 -> 0 bytes
-rw-r--r--pic/bmon/butterfree.pngbin628 -> 0 bytes
-rw-r--r--pic/bmon/caterpie.pngbin243 -> 0 bytes
-rw-r--r--pic/bmon/chansey.pngbin496 -> 0 bytes
-rw-r--r--pic/bmon/charizard.pngbin676 -> 0 bytes
-rw-r--r--pic/bmon/charmander.pngbin394 -> 0 bytes
-rw-r--r--pic/bmon/charmeleon.pngbin461 -> 0 bytes
-rw-r--r--pic/bmon/clefable.pngbin425 -> 0 bytes
-rw-r--r--pic/bmon/clefairy.pngbin375 -> 0 bytes
-rw-r--r--pic/bmon/cloyster.pngbin690 -> 0 bytes
-rw-r--r--pic/bmon/cubone.pngbin360 -> 0 bytes
-rw-r--r--pic/bmon/dewgong.pngbin460 -> 0 bytes
-rw-r--r--pic/bmon/diglett.pngbin314 -> 0 bytes
-rw-r--r--pic/bmon/ditto.pngbin275 -> 0 bytes
-rw-r--r--pic/bmon/dodrio.pngbin592 -> 0 bytes
-rw-r--r--pic/bmon/doduo.pngbin348 -> 0 bytes
-rw-r--r--pic/bmon/dragonair.pngbin459 -> 0 bytes
-rw-r--r--pic/bmon/dragonite.pngbin638 -> 0 bytes
-rw-r--r--pic/bmon/dratini.pngbin357 -> 0 bytes
-rw-r--r--pic/bmon/drowzee.pngbin499 -> 0 bytes
-rw-r--r--pic/bmon/dugtrio.pngbin565 -> 0 bytes
-rw-r--r--pic/bmon/eevee.pngbin374 -> 0 bytes
-rw-r--r--pic/bmon/ekans.pngbin376 -> 0 bytes
-rw-r--r--pic/bmon/electabuzz.pngbin515 -> 0 bytes
-rw-r--r--pic/bmon/electrode.pngbin323 -> 0 bytes
-rw-r--r--pic/bmon/exeggcute.pngbin664 -> 0 bytes
-rw-r--r--pic/bmon/exeggutor.pngbin713 -> 0 bytes
-rw-r--r--pic/bmon/farfetchd.pngbin614 -> 0 bytes
-rw-r--r--pic/bmon/fearow.pngbin564 -> 0 bytes
-rw-r--r--pic/bmon/flareon.pngbin515 -> 0 bytes
-rw-r--r--pic/bmon/gastly.pngbin668 -> 0 bytes
-rw-r--r--pic/bmon/gengar.pngbin447 -> 0 bytes
-rw-r--r--pic/bmon/geodude.pngbin321 -> 0 bytes
-rw-r--r--pic/bmon/gloom.pngbin429 -> 0 bytes
-rw-r--r--pic/bmon/golbat.pngbin691 -> 0 bytes
-rw-r--r--pic/bmon/goldeen.pngbin415 -> 0 bytes
-rw-r--r--pic/bmon/golduck.pngbin596 -> 0 bytes
-rw-r--r--pic/bmon/golem.pngbin519 -> 0 bytes
-rw-r--r--pic/bmon/graveler.pngbin568 -> 0 bytes
-rw-r--r--pic/bmon/grimer.pngbin441 -> 0 bytes
-rw-r--r--pic/bmon/growlithe.pngbin388 -> 0 bytes
-rw-r--r--pic/bmon/gyarados.pngbin759 -> 0 bytes
-rw-r--r--pic/bmon/haunter.pngbin555 -> 0 bytes
-rw-r--r--pic/bmon/hitmonchan.pngbin538 -> 0 bytes
-rw-r--r--pic/bmon/hitmonlee.pngbin587 -> 0 bytes
-rw-r--r--pic/bmon/horsea.pngbin291 -> 0 bytes
-rw-r--r--pic/bmon/hypno.pngbin638 -> 0 bytes
-rw-r--r--pic/bmon/ivysaur.pngbin431 -> 0 bytes
-rw-r--r--pic/bmon/jigglypuff.pngbin348 -> 0 bytes
-rw-r--r--pic/bmon/jolteon.pngbin514 -> 0 bytes
-rw-r--r--pic/bmon/jynx.pngbin578 -> 0 bytes
-rw-r--r--pic/bmon/kabuto.pngbin326 -> 0 bytes
-rw-r--r--pic/bmon/kabutops.pngbin560 -> 0 bytes
-rw-r--r--pic/bmon/kadabra.pngbin523 -> 0 bytes
-rw-r--r--pic/bmon/kakuna.pngbin316 -> 0 bytes
-rw-r--r--pic/bmon/kangaskhan.pngbin673 -> 0 bytes
-rw-r--r--pic/bmon/kingler.pngbin616 -> 0 bytes
-rw-r--r--pic/bmon/koffing.pngbin599 -> 0 bytes
-rw-r--r--pic/bmon/krabby.pngbin436 -> 0 bytes
-rw-r--r--pic/bmon/lapras.pngbin574 -> 0 bytes
-rw-r--r--pic/bmon/lickitung.pngbin514 -> 0 bytes
-rw-r--r--pic/bmon/machamp.pngbin653 -> 0 bytes
-rw-r--r--pic/bmon/machoke.pngbin633 -> 0 bytes
-rw-r--r--pic/bmon/machop.pngbin381 -> 0 bytes
-rw-r--r--pic/bmon/magikarp.pngbin533 -> 0 bytes
-rw-r--r--pic/bmon/magmar.pngbin496 -> 0 bytes
-rw-r--r--pic/bmon/magnemite.pngbin215 -> 0 bytes
-rw-r--r--pic/bmon/magneton.pngbin552 -> 0 bytes
-rw-r--r--pic/bmon/mankey.pngbin395 -> 0 bytes
-rw-r--r--pic/bmon/marowak.pngbin501 -> 0 bytes
-rw-r--r--pic/bmon/meowth.pngbin383 -> 0 bytes
-rw-r--r--pic/bmon/metapod.pngbin259 -> 0 bytes
-rw-r--r--pic/bmon/mew.pngbin365 -> 0 bytes
-rw-r--r--pic/bmon/mewtwo.pngbin652 -> 0 bytes
-rw-r--r--pic/bmon/moltres.pngbin747 -> 0 bytes
-rw-r--r--pic/bmon/mr.mime.pngbin475 -> 0 bytes
-rw-r--r--pic/bmon/muk.pngbin685 -> 0 bytes
-rw-r--r--pic/bmon/nidoking.pngbin752 -> 0 bytes
-rw-r--r--pic/bmon/nidoqueen.pngbin652 -> 0 bytes
-rw-r--r--pic/bmon/nidoranf.pngbin264 -> 0 bytes
-rw-r--r--pic/bmon/nidoranm.pngbin353 -> 0 bytes
-rw-r--r--pic/bmon/nidorina.pngbin438 -> 0 bytes
-rw-r--r--pic/bmon/nidorino.pngbin517 -> 0 bytes
-rw-r--r--pic/bmon/ninetales.pngbin658 -> 0 bytes
-rw-r--r--pic/bmon/oddish.pngbin267 -> 0 bytes
-rw-r--r--pic/bmon/omanyte.pngbin331 -> 0 bytes
-rw-r--r--pic/bmon/omastar.pngbin585 -> 0 bytes
-rw-r--r--pic/bmon/onix.pngbin558 -> 0 bytes
-rw-r--r--pic/bmon/paras.pngbin307 -> 0 bytes
-rw-r--r--pic/bmon/parasect.pngbin598 -> 0 bytes
-rw-r--r--pic/bmon/persian.pngbin619 -> 0 bytes
-rw-r--r--pic/bmon/pidgeot.pngbin581 -> 0 bytes
-rw-r--r--pic/bmon/pidgeotto.pngbin487 -> 0 bytes
-rw-r--r--pic/bmon/pidgey.pngbin303 -> 0 bytes
-rw-r--r--pic/bmon/pikachu.pngbin396 -> 0 bytes
-rw-r--r--pic/bmon/pinsir.pngbin617 -> 0 bytes
-rw-r--r--pic/bmon/poliwag.pngbin318 -> 0 bytes
-rw-r--r--pic/bmon/poliwhirl.pngbin478 -> 0 bytes
-rw-r--r--pic/bmon/poliwrath.pngbin513 -> 0 bytes
-rw-r--r--pic/bmon/ponyta.pngbin503 -> 0 bytes
-rw-r--r--pic/bmon/porygon.pngbin496 -> 0 bytes
-rw-r--r--pic/bmon/primeape.pngbin607 -> 0 bytes
-rw-r--r--pic/bmon/psyduck.pngbin423 -> 0 bytes
-rw-r--r--pic/bmon/raichu.pngbin595 -> 0 bytes
-rw-r--r--pic/bmon/rapidash.pngbin710 -> 0 bytes
-rw-r--r--pic/bmon/raticate.pngbin539 -> 0 bytes
-rw-r--r--pic/bmon/rattata.pngbin325 -> 0 bytes
-rw-r--r--pic/bmon/rhydon.pngbin657 -> 0 bytes
-rw-r--r--pic/bmon/rhyhorn.pngbin661 -> 0 bytes
-rw-r--r--pic/bmon/sandshrew.pngbin407 -> 0 bytes
-rw-r--r--pic/bmon/sandslash.pngbin556 -> 0 bytes
-rw-r--r--pic/bmon/scyther.pngbin690 -> 0 bytes
-rw-r--r--pic/bmon/seadra.pngbin482 -> 0 bytes
-rw-r--r--pic/bmon/seaking.pngbin627 -> 0 bytes
-rw-r--r--pic/bmon/seel.pngbin490 -> 0 bytes
-rw-r--r--pic/bmon/shellder.pngbin396 -> 0 bytes
-rw-r--r--pic/bmon/slowbro.pngbin765 -> 0 bytes
-rw-r--r--pic/bmon/slowpoke.pngbin428 -> 0 bytes
-rw-r--r--pic/bmon/snorlax.pngbin610 -> 0 bytes
-rw-r--r--pic/bmon/spearow.pngbin337 -> 0 bytes
-rw-r--r--pic/bmon/squirtle.pngbin318 -> 0 bytes
-rw-r--r--pic/bmon/starmie.pngbin537 -> 0 bytes
-rw-r--r--pic/bmon/staryu.pngbin401 -> 0 bytes
-rw-r--r--pic/bmon/tangela.pngbin532 -> 0 bytes
-rw-r--r--pic/bmon/tauros.pngbin622 -> 0 bytes
-rw-r--r--pic/bmon/tentacool.pngbin364 -> 0 bytes
-rw-r--r--pic/bmon/tentacruel.pngbin483 -> 0 bytes
-rw-r--r--pic/bmon/vaporeon.pngbin492 -> 0 bytes
-rw-r--r--pic/bmon/venomoth.pngbin597 -> 0 bytes
-rw-r--r--pic/bmon/venonat.pngbin390 -> 0 bytes
-rw-r--r--pic/bmon/venusaur.pngbin658 -> 0 bytes
-rw-r--r--pic/bmon/victreebel.pngbin603 -> 0 bytes
-rw-r--r--pic/bmon/vileplume.pngbin473 -> 0 bytes
-rw-r--r--pic/bmon/voltorb.pngbin245 -> 0 bytes
-rw-r--r--pic/bmon/vulpix.pngbin501 -> 0 bytes
-rw-r--r--pic/bmon/wartortle.pngbin451 -> 0 bytes
-rw-r--r--pic/bmon/weedle.pngbin286 -> 0 bytes
-rw-r--r--pic/bmon/weepinbell.pngbin436 -> 0 bytes
-rw-r--r--pic/bmon/weezing.pngbin709 -> 0 bytes
-rw-r--r--pic/bmon/wigglytuff.pngbin513 -> 0 bytes
-rw-r--r--pic/bmon/zapdos.pngbin621 -> 0 bytes
-rw-r--r--pic/bmon/zubat.pngbin389 -> 0 bytes
-rw-r--r--pic/ymon/fossilaerodactyl.png (renamed from pic/bmon/fossilaerodactyl.png)bin539 -> 539 bytes
-rw-r--r--pic/ymon/fossilkabutops.png (renamed from pic/bmon/fossilkabutops.png)bin546 -> 546 bytes
-rw-r--r--pokered.sn1bin69955 -> 0 bytes
-rw-r--r--pokeyellow.link (renamed from pokered.link)138
-rw-r--r--replace.sh3
-rw-r--r--roms.md53
-rwxr-xr-xscripts/AgathasRoom.asm3
-rw-r--r--scripts/BeachHouse.asm191
-rwxr-xr-xscripts/BeachHouse2.asm33
-rwxr-xr-xscripts/BikeShop.asm16
-rwxr-xr-xscripts/BillsHouse.asm253
-rwxr-xr-xscripts/BillsHouse2.asm158
-rwxr-xr-xscripts/BluesHouse.asm10
-rwxr-xr-xscripts/BrunosRoom.asm1
-rwxr-xr-xscripts/CeladonCity.asm14
-rwxr-xr-xscripts/CeladonCity2.asm8
-rwxr-xr-xscripts/CeladonDiner.asm37
-rwxr-xr-xscripts/CeladonDiner2.asm38
-rwxr-xr-xscripts/CeladonMansion1F.asm29
-rwxr-xr-xscripts/CeladonMansion1F_2.asm78
-rwxr-xr-xscripts/CeladonMansion3F.asm133
-rwxr-xr-xscripts/CeladonMansion3F_2.asm35
-rwxr-xr-xscripts/CeladonMansionRoof.asm3
-rwxr-xr-xscripts/CeladonMansionRoofHouse.asm3
-rwxr-xr-xscripts/CeladonMart1F.asm3
-rwxr-xr-xscripts/CeladonMart3F.asm35
-rwxr-xr-xscripts/CeladonMart3F_2.asm38
-rwxr-xr-xscripts/CeladonMart5F.asm3
-rwxr-xr-xscripts/CeladonMartRoof.asm14
-rwxr-xr-xscripts/CeladonPokecenter.asm6
-rwxr-xr-xscripts/CeruleanCave1F.asm1
-rwxr-xr-xscripts/CeruleanCave2F.asm1
-rwxr-xr-xscripts/CeruleanCaveB1F.asm4
-rwxr-xr-xscripts/CeruleanCity.asm25
-rwxr-xr-xscripts/CeruleanGym.asm2
-rwxr-xr-xscripts/CeruleanPokecenter.asm6
-rwxr-xr-xscripts/CeruleanTradeHouse.asm99
-rwxr-xr-xscripts/ChampionsRoom.asm26
-rwxr-xr-xscripts/CinnabarGym.asm208
-rwxr-xr-xscripts/CinnabarGym3.asm64
-rwxr-xr-xscripts/CinnabarGym_2.asm18
-rwxr-xr-xscripts/CinnabarIsland.asm2
-rwxr-xr-xscripts/CinnabarPokecenter.asm6
-rw-r--r--[-rwxr-xr-x]scripts/Colosseum.asm0
-rwxr-xr-xscripts/CopycatsHouse2F.asm2
-rwxr-xr-xscripts/Daycare.asm29
-rwxr-xr-xscripts/FuchsiaMart.asm3
-rwxr-xr-xscripts/FuchsiaPokecenter.asm6
-rwxr-xr-xscripts/GameCorner.asm16
-rwxr-xr-xscripts/GameCorner2.asm12
-rwxr-xr-xscripts/IndigoPlateauLobby.asm6
-rwxr-xr-xscripts/LancesRoom.asm13
-rwxr-xr-xscripts/LavenderPokecenter.asm6
-rwxr-xr-xscripts/MtMoon1F.asm19
-rwxr-xr-xscripts/MtMoonB2F.asm523
-rwxr-xr-xscripts/MtMoonB2F_2.asm28
-rwxr-xr-xscripts/MtMoonPokecenter.asm72
-rwxr-xr-xscripts/MtMoonPokecenter2.asm66
-rwxr-xr-xscripts/Museum1F.asm196
-rwxr-xr-xscripts/Museum1F2.asm211
-rwxr-xr-xscripts/Museum2F.asm34
-rwxr-xr-xscripts/OaksLab.asm911
-rwxr-xr-xscripts/OaksLab2.asm28
-rwxr-xr-xscripts/PalletTown.asm172
-rwxr-xr-xscripts/PewterCity.asm16
-rwxr-xr-xscripts/PewterGym.asm19
-rwxr-xr-xscripts/PewterMart.asm2
-rwxr-xr-xscripts/PewterNidoranHouse.asm3
-rwxr-xr-xscripts/PewterPokecenter.asm79
-rwxr-xr-xscripts/PewterPokecenter2.asm78
-rwxr-xr-xscripts/PokemonFanClub.asm240
-rwxr-xr-xscripts/PokemonMansion1F.asm2
-rwxr-xr-xscripts/PokemonMansion2F.asm2
-rwxr-xr-xscripts/PokemonMansion3F.asm2
-rwxr-xr-xscripts/PokemonMansionB1F.asm2
-rwxr-xr-xscripts/PokemonTower1F.asm3
-rwxr-xr-xscripts/PokemonTower2F.asm24
-rwxr-xr-xscripts/PokemonTower2F_2.asm12
-rwxr-xr-xscripts/PokemonTower7F.asm471
-rwxr-xr-xscripts/PowerPlant.asm2
-rwxr-xr-xscripts/RedsHouse1F.asm60
-rwxr-xr-xscripts/RedsHouse1F2.asm58
-rwxr-xr-xscripts/RedsHouse2F.asm19
-rwxr-xr-xscripts/RockTunnelPokecenter.asm10
-rwxr-xr-xscripts/RocketHideoutB4F.asm421
-rwxr-xr-xscripts/Route1.asm47
-rwxr-xr-xscripts/Route11Gate2F.asm4
-rwxr-xr-xscripts/Route12Gate2F.asm2
-rwxr-xr-xscripts/Route19.asm30
-rwxr-xr-xscripts/Route1_2.asm53
-rwxr-xr-xscripts/Route22.asm135
-rwxr-xr-xscripts/Route22Gate.asm9
-rwxr-xr-xscripts/Route22_2.asm50
-rwxr-xr-xscripts/Route23.asm2
-rwxr-xr-xscripts/Route24.asm60
-rwxr-xr-xscripts/Route25.asm23
-rwxr-xr-xscripts/Route6.asm6
-rwxr-xr-xscripts/Route7.asm3
-rwxr-xr-xscripts/Route8Gate.asm2
-rwxr-xr-xscripts/Route9.asm24
-rwxr-xr-xscripts/SSAnne2F.asm23
-rwxr-xr-xscripts/SSAnne2FRooms.asm33
-rwxr-xr-xscripts/SSAnne2FRooms_2.asm35
-rwxr-xr-xscripts/SSAnneCaptainsRoom.asm14
-rwxr-xr-xscripts/SafariZoneGate.asm114
-rwxr-xr-xscripts/SafariZoneGate2.asm251
-rwxr-xr-xscripts/SaffronPokecenter.asm6
-rwxr-xr-xscripts/SeafoamIslandsB4F.asm3
-rwxr-xr-xscripts/SilphCo11F.asm538
-rwxr-xr-xscripts/SilphCo11F_2.asm76
-rwxr-xr-xscripts/SilphCo7F.asm24
-rw-r--r--[-rwxr-xr-x]scripts/TradeCenter.asm0
-rwxr-xr-xscripts/VermilionCity.asm73
-rwxr-xr-xscripts/VermilionCity2.asm111
-rwxr-xr-xscripts/VermilionDock.asm6
-rwxr-xr-xscripts/VermilionPokecenter.asm6
-rwxr-xr-xscripts/VermilionTradeHouse.asm7
-rwxr-xr-xscripts/VictoryRoad1F.asm3
-rwxr-xr-xscripts/VictoryRoad2F.asm13
-rwxr-xr-xscripts/VictoryRoad3F.asm3
-rwxr-xr-xscripts/ViridianCity.asm446
-rwxr-xr-xscripts/ViridianCity2.asm215
-rwxr-xr-xscripts/ViridianForest.asm100
-rwxr-xr-xscripts/ViridianForest2.asm53
-rwxr-xr-xscripts/ViridianForestSouthGate.asm3
-rwxr-xr-xscripts/ViridianMart.asm16
-rwxr-xr-xscripts/ViridianPokecenter.asm6
-rwxr-xr-xscripts/ViridianSchoolHouse.asm14
-rwxr-xr-xscripts/ViridianSchoolHouse2.asm17
-rw-r--r--text.asm444
-rwxr-xr-xtext/credits_text.asm343
-rwxr-xr-xtext/map_names.asm2
-rw-r--r--text/maps/AgathasRoom.asm2
-rw-r--r--text/maps/BeachHouse.asm103
-rw-r--r--text/maps/BikeShop.asm2
-rw-r--r--text/maps/BillsHouse.asm5
-rw-r--r--text/maps/BluesHouse.asm8
-rw-r--r--text/maps/CeladonCity.asm44
-rw-r--r--text/maps/CeladonMansion1F.asm57
-rw-r--r--text/maps/CeladonMansion3F.asm51
-rw-r--r--text/maps/CeladonMart3F.asm54
-rw-r--r--text/maps/CeladonMart4F.asm8
-rw-r--r--text/maps/CeladonMartRoof.asm5
-rw-r--r--text/maps/CeruleanBadgeHouse.asm33
-rwxr-xr-xtext/maps/CeruleanBadgeHouse_2.asm28
-rw-r--r--text/maps/CeruleanCity.asm34
-rw-r--r--text/maps/CeruleanGym.asm29
-rw-r--r--text/maps/CeruleanTradeHouse.asm46
-rw-r--r--text/maps/CinnabarGym.asm43
-rw-r--r--text/maps/CinnabarIsland.asm2
-rw-r--r--text/maps/CopycatsHouse1F.asm4
-rw-r--r--text/maps/Daycare.asm34
-rw-r--r--text/maps/Daycare_2.asm33
-rw-r--r--text/maps/FightingDojo.asm4
-rw-r--r--text/maps/FuchsiaCity.asm2
-rw-r--r--text/maps/FuchsiaGym.asm194
-rw-r--r--text/maps/FuchsiaGym_2.asm193
-rw-r--r--text/maps/GameCorner.asm5
-rwxr-xr-xtext/maps/GameCorner_2.asm4
-rw-r--r--text/maps/HallOfFame.asm2
-rw-r--r--text/maps/LancesRoom.asm2
-rw-r--r--text/maps/MtMoon1F.asm2
-rw-r--r--text/maps/MtMoonB2F.asm39
-rw-r--r--text/maps/MtMoonPokecenter.asm8
-rw-r--r--text/maps/Museum1F.asm2
-rw-r--r--text/maps/Museum2F.asm14
-rw-r--r--text/maps/NameRatersHouse.asm2
-rw-r--r--text/maps/OaksLab.asm341
-rw-r--r--text/maps/PalletTown.asm18
-rw-r--r--text/maps/PewterGym.asm166
-rw-r--r--text/maps/PewterGym_2.asm144
-rw-r--r--text/maps/PewterMart.asm2
-rw-r--r--text/maps/PewterPokecenter.asm13
-rw-r--r--text/maps/PokemonFanClub.asm75
-rw-r--r--text/maps/PokemonTower7F.asm77
-rw-r--r--text/maps/RedsHouse1F.asm13
-rw-r--r--text/maps/RockTunnelB1F.asm21
-rw-r--r--text/maps/RockTunnelB1F_2.asm20
-rw-r--r--text/maps/RocketHideoutB4F.asm55
-rw-r--r--text/maps/Route10.asm2
-rw-r--r--text/maps/Route11.asm29
-rw-r--r--text/maps/Route11_2.asm28
-rw-r--r--text/maps/Route12.asm2
-rw-r--r--text/maps/Route12Gate2F.asm2
-rw-r--r--text/maps/Route14.asm2
-rw-r--r--text/maps/Route16.asm2
-rw-r--r--text/maps/Route17.asm2
-rw-r--r--text/maps/Route22.asm72
-rw-r--r--text/maps/Route24.asm119
-rw-r--r--text/maps/Route24_2.asm90
-rw-r--r--text/maps/Route25.asm4
-rw-r--r--text/maps/Route3.asm4
-rw-r--r--text/maps/Route6.asm31
-rw-r--r--text/maps/Route8.asm2
-rw-r--r--text/maps/Route9.asm41
-rwxr-xr-xtext/maps/Route9_2.asm21
-rw-r--r--text/maps/SSAnne2FRooms.asm54
-rw-r--r--text/maps/SSAnneCaptainsRoom.asm4
-rw-r--r--text/maps/SSAnneKitchen.asm2
-rw-r--r--text/maps/SafariZoneGate.asm89
-rw-r--r--text/maps/SaffronGates.asm4
-rw-r--r--text/maps/SaffronGym.asm3
-rw-r--r--text/maps/SilphCo10F.asm26
-rw-r--r--text/maps/SilphCo11F.asm24
-rw-r--r--text/maps/SilphCo2F.asm2
-rw-r--r--text/maps/SilphCo5F.asm58
-rw-r--r--text/maps/SilphCo5F_2.asm55
-rw-r--r--text/maps/SilphCo7F.asm4
-rw-r--r--text/maps/VermilionCity.asm53
-rw-r--r--text/maps/VermilionGym.asm175
-rw-r--r--text/maps/VermilionGym_2.asm144
-rw-r--r--text/maps/ViridianCity.asm84
-rw-r--r--text/maps/ViridianForest.asm36
-rw-r--r--text/maps/ViridianForestSouthGate.asm11
-rw-r--r--text/maps/ViridianGym.asm4
-rw-r--r--text/maps/ViridianMart.asm10
-rwxr-xr-x[-rw-r--r--]text/maps/ViridianPokecenter.asm0
-rw-r--r--text/maps/ViridianSchoolHouse.asm7
-rw-r--r--text/move_names.asm1
-rw-r--r--text/pokedex.asm2114
-rw-r--r--text/pokedex_ratings.asm117
-rw-r--r--text/unused_names.asm4
-rw-r--r--tools/pokemontools/pcm.py156
-rwxr-xr-xwram.asm1569
1166 files changed, 41269 insertions, 19119 deletions
diff --git a/.gitattributes b/.gitattributes
index bc973be0..3b289089 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -15,4 +15,4 @@
*.map binary
*.wav binary
*.blk binary
-*.pic binary
+*.pic binary \ No newline at end of file
diff --git a/.gitignore b/.gitignore
index e2a884db..faf283c7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -19,6 +19,9 @@
*.1bpp
*.pic
+# converted audio data
+*.pcm
+
# swap files for vim
.*.swp
@@ -30,6 +33,27 @@
*.sav
*.sys
+# lol bgb
+*.sn1
+*.sn2
+*.sn3
+*.sn4
+*.sn5
+*.sn6
+*.sn7
+*.sn8
+*.sn9
+*.sn0
+
+# replace.sh
+replace.sh
+
+# leftover txt files from diff
+*.txt
+
# for vim configuration
# url: http://www.vim.org/scripts/script.php?script_id=441
.lvimrc
+
+# extras is a submodule, don't include
+extras/
diff --git a/.gitmodules b/.gitmodules
deleted file mode 100644
index e69de29b..00000000
--- a/.gitmodules
+++ /dev/null
diff --git a/INSTALL.md b/INSTALL.md
index c708a013..00cfd03c 100644
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -8,18 +8,13 @@
sudo make install
cd ..
- 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**:
make
-To build them individually:
-
- make red
- make blue
-
# Mac
@@ -30,10 +25,10 @@ Then in **Terminal**, run:
xcode-select --install
brew install rgbds
- 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**:
make
@@ -52,9 +47,9 @@ Then download [**rgbds**](https://github.com/rednex/rgbds/releases/): the latest
In the **Cygwin terminal**, enter these commands:
- 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**:
make
diff --git a/Makefile b/Makefile
index 04a08e05..27363d87 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,9 @@
-roms := pokered.gbc pokeblue.gbc
+PYTHON := python
+pcm := $(PYTHON) tools/pokemontools/pcm.py pcm
-pokered_obj := audio_red.o main_red.o text_red.o wram_red.o
-pokeblue_obj := audio_blue.o main_blue.o text_blue.o wram_blue.o
+rom := pokeyellow.gbc
+
+objs := audio.o main.o text.o wram.o
### Build tools
@@ -21,23 +23,22 @@ RGBLINK ?= $(RGBDS)rgblink
.SECONDEXPANSION:
.PRECIOUS:
.SECONDARY:
-.PHONY: all red blue clean tidy compare tools
+.PHONY: all yellow clean tidy compare tools
-all: $(roms)
-red: pokered.gbc
-blue: pokeblue.gbc
+all: $(rom)
+yellow: $(rom)
# For contributors to make sure a change didn't affect the contents of the rom.
-compare: $(roms)
+compare: $(rom)
@$(MD5) roms.md5
clean:
- rm -f $(roms) $(pokered_obj) $(pokeblue_obj) $(roms:.gbc=.sym)
- find . \( -iname '*.1bpp' -o -iname '*.2bpp' -o -iname '*.pic' \) -exec rm {} +
+ rm -f $(rom) $(objs) $(rom:.gbc=.sym)
+ find . \( -iname '*.1bpp' -o -iname '*.2bpp' -o -iname '*.pic' -o -iname '*.pcm' \) -exec rm {} +
$(MAKE) clean -C tools/
tidy:
- rm -f $(roms) $(pokered_obj) $(pokeblue_obj) $(roms:.gbc=.sym)
+ rm -f $(rom) $(objs) $(rom:.gbc=.sym)
$(MAKE) clean -C tools/
tools:
@@ -53,35 +54,27 @@ endif
%.asm: ;
-%_red.o: dep = $(shell tools/scan_includes $(@D)/$*.asm)
-$(pokered_obj): %_red.o: %.asm $$(dep)
- $(RGBASM) -D _RED -h -o $@ $*.asm
-
-%_blue.o: dep = $(shell tools/scan_includes $(@D)/$*.asm)
-$(pokeblue_obj): %_blue.o: %.asm $$(dep)
- $(RGBASM) -D _BLUE -h -o $@ $*.asm
+%.o: dep = $(shell tools/scan_includes $(@D)/$*.asm)
+$(objs): %.o: %.asm $$(dep)
+ $(RGBASM) -h -o $@ $*.asm
-pokered_opt = -jsv -k 01 -l 0x33 -m 0x13 -p 0 -r 03 -t "POKEMON RED"
-pokeblue_opt = -jsv -k 01 -l 0x33 -m 0x13 -p 0 -r 03 -t "POKEMON BLUE"
+opts = -cjsv -k 01 -l 0x33 -m 0x1b -p 0 -r 03 -t "POKEMON YELLOW"
-%.gbc: $$(%_obj)
- $(RGBLINK) -d -n $*.sym -l pokered.link -o $@ $^
- $(RGBFIX) $($*_opt) $@
- sort $*.sym -o $*.sym
+$(rom): $(objs)
+ $(RGBLINK) -n pokeyellow.sym -l pokeyellow.link -o $@ $^
+ $(RGBFIX) $(opts) $@
+ sort $(rom:.gbc=.sym) -o $(rom:.gbc=.sym)
### Misc file-specific graphics rules
-gfx/blue/intro_purin_1.2bpp: $(RGBGFX) += -h
-gfx/blue/intro_purin_2.2bpp: $(RGBGFX) += -h
-gfx/blue/intro_purin_3.2bpp: $(RGBGFX) += -h
-gfx/red/intro_nido_1.2bpp: $(RGBGFX) += -h
-gfx/red/intro_nido_2.2bpp: $(RGBGFX) += -h
-gfx/red/intro_nido_3.2bpp: $(RGBGFX) += -h
-
gfx/game_boy.2bpp: tools/gfx += --remove-duplicates
gfx/theend.2bpp: tools/gfx += --interleave --png=$<
gfx/tilesets/%.2bpp: tools/gfx += --trim-whitespace
+gfx/pokemon_yellow.2bpp: tools/gfx += --trim-whitespace
+gfx/surfing_pikachu_1c.2bpp: tools/gfx += --trim-whitespace
+gfx/surfing_pikachu_3.2bpp: tools/gfx += --trim-whitespace
+gfx/surfing_pikachu_1.2bpp: tools/gfx += --trim-whitespace
### Catch-all graphics rules
@@ -100,3 +93,7 @@ gfx/tilesets/%.2bpp: tools/gfx += --trim-whitespace
%.pic: %.2bpp
tools/pkmncompress $< $@
+
+
+%.wav: ;
+%.pcm: %.wav ; @$(pcm) $<
diff --git a/README.md b/README.md
index 49503a3e..0d2cb2d7 100644
--- a/README.md
+++ b/README.md
@@ -1,18 +1,17 @@
-# Pokémon Red and Blue
+# Pokémon Yellow
-This is a disassembly of Pokémon Red and Blue.
+This is a disassembly of Pokémon Yellow.
-It builds the following roms:
+It builds the following rom:
-* Pokemon Red (UE) [S][!].gb `md5: 3d45c1ee9abd5738df46d2bdda8b57dc`
-* Pokemon Blue (UE) [S][!].gb `md5: 50927e843568814f7ed45ec4f944bd8b`
+* Pokemon Yellow (UE) [C][!].gbc `md5: d9290db87b1f0a23b89f99ee4469e34b`
To set up the repository, see [**INSTALL.md**](INSTALL.md).
## See also
-* Disassembly of [**Pokémon Yellow**][pokeyellow]
+* Disassembly of [**Pokémon Red/Blue**][pokered]
* Disassembly of [**Pokémon Gold**][pokegold]
* Disassembly of [**Pokémon Crystal**][pokecrystal]
* Disassembly of [**Pokémon Pinball**][pokepinball]
@@ -23,7 +22,7 @@ To set up the repository, see [**INSTALL.md**](INSTALL.md).
* Discord: [**pret**][Discord]
* irc: **irc.freenode.net** [**#pret**][irc]
-[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
diff --git a/audio.asm b/audio.asm
index 70d81649..9e1a6046 100644
--- a/audio.asm
+++ b/audio.asm
@@ -10,6 +10,9 @@ INCLUDE "audio/headers/sfxheaders2.asm"
SECTION "Sound Effect Headers 3", ROMX ; BANK $1f
INCLUDE "audio/headers/sfxheaders3.asm"
+SECTION "Sound Effect Headers 4", ROMX ; BANK $20
+INCLUDE "audio/headers/sfxheaders4.asm"
+
SECTION "Music Headers 1", ROMX ; BANK $02
INCLUDE "audio/headers/musicheaders1.asm"
@@ -20,6 +23,9 @@ INCLUDE "audio/headers/musicheaders2.asm"
SECTION "Music Headers 3", ROMX ; BANK $1f
INCLUDE "audio/headers/musicheaders3.asm"
+SECTION "Music Headers 4", ROMX ; BANK $20
+INCLUDE "audio/headers/musicheaders4.asm"
+
SECTION "Sound Effects 1", ROMX ; BANK $02
@@ -43,7 +49,7 @@ 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"
+; Audio1_WavePointers: INCLUDE "audio/wave_instruments.asm"
INCLUDE "audio/sfx/start_menu_1.asm"
INCLUDE "audio/sfx/pokeflute.asm"
@@ -142,7 +148,7 @@ 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"
+; Audio2_WavePointers: INCLUDE "audio/wave_instruments.asm"
INCLUDE "audio/sfx/press_ab_2.asm"
INCLUDE "audio/sfx/start_menu_2.asm"
@@ -155,6 +161,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"
@@ -267,7 +274,7 @@ 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"
+; Audio3_WavePointers: INCLUDE "audio/wave_instruments.asm"
INCLUDE "audio/sfx/start_menu_3.asm"
INCLUDE "audio/sfx/cut_3.asm"
@@ -352,16 +359,93 @@ INCLUDE "audio/sfx/cry21_3.asm"
INCLUDE "audio/sfx/cry22_3.asm"
+SECTION "Sound Effects 4", ROMX ; BANK $20
+
+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/surfing_add_points.asm"
+INCLUDE "audio/sfx/unknown_80263.asm"
+INCLUDE "audio/sfx/unknown_8026a.asm"
+INCLUDE "audio/sfx/unknown_8027f.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_crash.asm"
+INCLUDE "audio/sfx/surfing_land.asm"
+INCLUDE "audio/sfx/get_item2_4_2.asm"
+INCLUDE "audio/sfx/unknown_80337.asm"
+INCLUDE "audio/sfx/unknown_80383.asm"
+INCLUDE "audio/sfx/unknown_803da.asm"
+INCLUDE "audio/sfx/unknown_80411.asm"
+INCLUDE "audio/sfx/unknown_80467.asm"
+INCLUDE "audio/sfx/unknown_804bf.asm"
+INCLUDE "audio/sfx/unknown_804fa.asm"
+INCLUDE "audio/sfx/unknown_80545.asm"
+INCLUDE "audio/sfx/unknown_8058b.asm"
+INCLUDE "audio/sfx/unknown_805db.asm"
+INCLUDE "audio/sfx/unknown_80603.asm"
+INCLUDE "audio/sfx/unknown_80633.asm"
+INCLUDE "audio/sfx/unknown_80661.asm"
+INCLUDE "audio/sfx/unknown_80689.asm"
+INCLUDE "audio/sfx/unknown_806af.asm"
+INCLUDE "audio/sfx/unknown_80712.asm"
+INCLUDE "audio/sfx/unknown_80760.asm"
+INCLUDE "audio/sfx/unknown_8077e.asm"
+INCLUDE "audio/sfx/unknown_807eb.asm"
+INCLUDE "audio/sfx/unknown_8081e.asm"
+INCLUDE "audio/sfx/unknown_80879.asm"
+INCLUDE "audio/sfx/unknown_808a9.asm"
+INCLUDE "audio/sfx/unknown_808fa.asm"
+INCLUDE "audio/sfx/unknown_8091c.asm"
+INCLUDE "audio/sfx/unknown_80944.asm"
+INCLUDE "audio/sfx/unknown_8097f.asm"
+INCLUDE "audio/sfx/unknown_809b2.asm"
+INCLUDE "audio/sfx/unknown_809fb.asm"
+INCLUDE "audio/sfx/unknown_80a23.asm"
+INCLUDE "audio/sfx/unknown_80a89.asm"
+INCLUDE "audio/sfx/unknown_80ad2.asm"
+INCLUDE "audio/sfx/unknown_80b05.asm"
+INCLUDE "audio/sfx/unknown_80b53.asm"
+INCLUDE "audio/sfx/unknown_80b9c.asm"
+INCLUDE "audio/sfx/unknown_80be2.asm"
+INCLUDE "audio/sfx/unknown_80c3b.asm"
+INCLUDE "audio/sfx/unknown_80c6e.asm"
+INCLUDE "audio/sfx/unknown_80ca1.asm"
+INCLUDE "audio/sfx/unknown_80ce7.asm"
+INCLUDE "audio/music/printer.asm"
+INCLUDE "audio/sfx/get_item1_4.asm"
+INCLUDE "audio/sfx/unknown_80e91.asm"
+INCLUDE "audio/sfx/get_item2_4.asm"
+
SECTION "Audio Engine 1", ROMX ; BANK $02
+AudioEngine1::
+
PlayBattleMusic::
xor a
ld [wAudioFadeOutControl], a
ld [wLowHealthAlarm], a
- dec a
- ld [wNewSoundID], a
- call PlaySound ; stop music
+ call StopAllMusic
call DelayFrame
ld c, BANK(Music_GymLeaderBattle)
ld a, [wGymLeaderNo]
@@ -418,17 +502,20 @@ 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 asm_99ed
; applies both the alternate start and alternate tempo
Music_RivalAlternateStartAndTempo::
call Music_RivalAlternateStart
- ld hl, wChannelCommandPointers
ld de, Music_MeetRival_branch_b19b
+asm_99ed:
+ ld hl, wChannelCommandPointers
jp Audio1_OverwriteChannelPointer
+; XXX
+ ret
+
; an alternate tempo for Cities1 which is used for the Hall of Fame room
Music_Cities1AlternateTempo::
ld a, 10
@@ -448,6 +535,8 @@ Music_Cities1AlternateTempo::
SECTION "Audio Engine 2", ROMX ; BANK $08
+AudioEngine2::
+
Music_DoLowHealthAlarm::
ld a, [wLowHealthAlarm]
cp $ff
@@ -524,34 +613,15 @@ Music_DoLowHealthAlarm::
.toneDataSilence
db $00,$00,$00,$80
-
INCLUDE "engine/menu/bills_pc.asm"
INCLUDE "audio/engine_2.asm"
-Music_PokeFluteInBattle::
- ; begin playing the "caught mon" sound effect
- ld a, SFX_CAUGHT_MON
- call PlaySoundWaitForCurrent
- ; then immediately overwrite the channel pointers
- ld hl, wChannelCommandPointers + Ch5 * 2
- ld de, SFX_Pokeflute_Ch5
- call Audio2_OverwriteChannelPointer
- ld de, SFX_Pokeflute_Ch6
- call Audio2_OverwriteChannelPointer
- ld de, SFX_Pokeflute_Ch7
-
-Audio2_OverwriteChannelPointer:
- ld a, e
- ld [hli], a
- ld a, d
- ld [hli], a
- ret
-
-
SECTION "Audio Engine 3", ROMX ; BANK $1f
+AudioEngine3::
+
PlayPokedexRatingSfx::
ld a, [$ffdc]
ld c, $0
@@ -564,9 +634,7 @@ PlayPokedexRatingSfx::
jr .getSfxPointer
.gotSfxPointer
push bc
- ld a, $ff
- ld [wNewSoundID], a
- call PlaySoundWaitForCurrent
+ call StopAllMusic
pop bc
ld b, $0
ld hl, PokedexRatingSfxPointers
@@ -589,13 +657,22 @@ PokedexRatingSfxPointers:
OwnedMonValues:
db 10, 40, 60, 90, 120, 150, $ff
-
INCLUDE "audio/engine_3.asm"
+SECTION "Audio Engine 4", ROMX ; BANK $20
+
+SurfingPikachu1Graphics1:: INCBIN "gfx/surfing_pikachu_1a.2bpp"
+SurfingPikachu1Graphics2:: INCBIN "gfx/surfing_pikachu_1b.2bpp"
+SurfingPikachu1Graphics3:: INCBIN "gfx/surfing_pikachu_1c.2bpp"
+
+INCLUDE "audio/engine_4.asm"
+
SECTION "Music 1", ROMX ; BANK $02
+Audio1_WavePointers: INCLUDE "audio/wave_instruments.asm"
+
INCLUDE "audio/music/pkmnhealed.asm"
INCLUDE "audio/music/routes1.asm"
INCLUDE "audio/music/routes2.asm"
@@ -625,7 +702,6 @@ INCLUDE "audio/music/pokecenter.asm"
SECTION "Music 2", ROMX ; BANK $08
-INCLUDE "audio/sfx/pokeflute_ch5_ch6.asm"
INCLUDE "audio/sfx/unused2_2.asm"
INCLUDE "audio/music/gymleaderbattle.asm"
INCLUDE "audio/music/trainerbattle.asm"
@@ -663,4 +739,16 @@ 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 ; BANK $20
+
+INCLUDE "audio/music/surfingpikachu.asm"
+INCLUDE "audio/music/yellowunusedsong.asm"
+INCLUDE "audio/music/meetjessiejames.asm"
+
+INCBIN "audio/unknown_832b9.bin"
+; cries are in different banks
+INCLUDE "audio/pikachu_cries.asm"
diff --git a/audio/engine_1.asm b/audio/engine_1.asm
index 11962d55..bd021ab3 100644
--- a/audio/engine_1.asm
+++ b/audio/engine_1.asm
@@ -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 ; no
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
ld 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(AudioEngine2)
+ 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 $ff
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, $8
- ld hl, wChannelReturnAddresses
- call .FillMem
- ld hl, wChannelCommandPointers
- call .FillMem
- ld d, $4
- 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
- ld [rNR50], a
- ld a, $8
- ld [rNR10], a
- ld a, 0
- ld [rNR51], a
- xor a
- ld [rNR30], a
- ld a, $80
- ld [rNR30], a
- ld a, $77
- ld [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
- ld [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
- ld [rNR52], a ; sound hardware on
- ld [rNR30], a ; wave playback on
- xor a
- ld [rNR51], a ; no sound output
- ld [rNR32], a ; mute channel 3 (wave channel)
- ld a, $8
- ld [rNR10], a ; sweep off
- ld [rNR12], a ; mute channel 1 (pulse channel 1)
- ld [rNR22], a ; mute channel 2 (pulse channel 2)
- ld [rNR42], a ; mute channel 4 (noise channel)
- ld a, $40
- ld [rNR14], a ; counter mode
- ld [rNR24], a
- ld [rNR44], a
- ld a, $77
- ld [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:
dw $F82C ; C_
diff --git a/audio/engine_2.asm b/audio/engine_2.asm
index 026ade7c..5fe686a8 100644
--- a/audio/engine_2.asm
+++ b/audio/engine_2.asm
@@ -2,1407 +2,218 @@
; 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
- ld [rNR51], a
- ld [rNR30], a
- ld a, $80
- ld [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 $ff
+ 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 $ff ; is this command a sound_ret?
- jp nz, Audio2_sound_call ; no
- 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
- ld [rNR30], a
- ld a, $80
- ld [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
- ld a, [rNR51]
- and [hl]
- ld [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]
- ld [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 $fd ; is this command a sound_call?
- jp nz, Audio2_sound_loop ; no
- 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 $fe ; is this command a sound_loop?
- jp nz, Audio2_note_type ; no
- 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 $d0 ; is this command a note_type?
- jp nz, Audio2_toggle_perfect_pitch ; no
- 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 $e8 ; is this command a toggle_perfect_pitch?
- jr nz, Audio2_vibrato ; no
- 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 $ea ; is this command a vibrato?
- jr nz, Audio2_pitch_slide ; no
- 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 $eb ; is this command a pitch_slide?
- jr nz, Audio2_duty_cycle ; no
- 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 $ec ; is this command a duty_cycle?
- jr nz, Audio2_tempo ; no
- 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 $ed ; is this command a tempo?
- jr nz, Audio2_stereo_panning ; no
- 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 $ee ; is this command a stereo_panning?
- jr nz, Audio2_unknownmusic0xef ; no
- call Audio2_GetNextMusicByte
- ld [wStereoPanning], a ; store panning
- jp Audio2_sound_ret
-
-; this appears to never be used
-Audio2_unknownmusic0xef:
- cp $ef ; is this command an unknownmusic0xef?
- jr nz, Audio2_duty_cycle_pattern ; no
- 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 $fc ; is this command a duty_cycle_pattern?
- jr nz, Audio2_volume ; no
- 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 $f0 ; is this command a volume?
- jr nz, Audio2_execute_music ; no
- call Audio2_GetNextMusicByte
- ld [rNR50], a ; store volume
- jp Audio2_sound_ret
-
-Audio2_execute_music:
- cp $f8 ; is this command an execute_music?
- jr nz, Audio2_octave ; no
- ld b, $0
- ld hl, wChannelFlags2
- add hl, bc
- set BIT_EXECUTE_MUSIC, [hl]
- jp Audio2_sound_ret
-
-Audio2_octave:
- and $f0
- cp $e0 ; is this command an octave?
- jr nz, Audio2_sfx_note ; no
- 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 $20 ; is this command a sfx_note?
- 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 $10 ; is this command a pitch_sweep?
- jr nz, Audio2_note ; no
- ld b, $0
- ld hl, wChannelFlags2
- add hl, bc
- bit BIT_EXECUTE_MUSIC, [hl]
- jr nz, Audio2_note ; no
- call Audio2_GetNextMusicByte
- ld [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 $b0 ; is this command a drum_note?
- jr z, .drum_note
- jr nc, Audio2_note_length ; no
-
- ; this executes when on the noise channel and
- ; the command id is less than $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 $c0 ; compare to rest
- 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
- ld a, [rNR51]
- and [hl]
- ld [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
- ld 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
- ld 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
- ld [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, $ff30 ; wave pattern RAM
- ld b, $f
- ld a, $0 ; stop hardware channel 3
- ld [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
- ld [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 nz, .commandPointerLoop
+ ld a, [wSoundID]
+ cp CRY_SFX_START
+ jr nc, .maybeCry
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
+.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 a, [hl]
- sbc 0
- ld [hl], a
- scf
- ret
+ ld [hl], d ; overwrite pointer to point to sound_ret
+ ld a, [wSavedVolume]
+ and a
+ jr nz, .done
+ ld a, [rNR50]
+ ld [wSavedVolume], a
+ ld a, $77
+ ld [rNR50], a
.done
- scf
- ccf
ret
-Audio2_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
-
-; --- 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_CryRet:
+ sound_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
+Music_PokeFluteInBattle::
+ ; begin playing the "caught mon" sound effect
+ ld a, SFX_CAUGHT_MON
+ call PlaySoundWaitForCurrent
+ ; then immediately overwrtie the channel pointers
+ ld hl, wChannelCommandPointers + Ch5 * 2
+ ld de, SFX_Pokeflute_Ch5
+ call Audio2_OverwriteChannelPointer
+ ld de, SFX_Pokeflute_Ch6
+ call Audio2_OverwriteChannelPointer
+ ld de, SFX_Pokeflute_Ch7
+
+Audio2_OverwriteChannelPointer:
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
-
-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
- 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
- and a
- jr z, .done
- jr .loop
-.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
+ ld [hli], a
ret
-Audio2_PlaySound::
- ld [wSoundID], a
- cp $ff
- jp z, .stopAllAudio
- cp MAX_SFX_ID_2
- jp z, .playSfx
- jp c, .playSfx
- cp $fe
- jr z, .playMusic
- jp nc, .playSfx
+INCLUDE "audio/sfx/pokeflute_ch5_ch6.asm"
-.playMusic
+Audio2_InitMusicVariables::
xor a
ld [wUnusedC000], a
ld [wDisableChannelOutputWhenSfxEnds], a
@@ -1411,53 +222,53 @@ Audio2_PlaySound::
ld [wSfxWaveInstrument], a
ld d, $8
ld hl, wChannelReturnAddresses
- call .FillMem
+ call Audio2_FillMem
ld hl, wChannelCommandPointers
- call .FillMem
+ call Audio2_FillMem
ld d, $4
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 +284,9 @@ Audio2_PlaySound::
ld [rNR30], a
ld a, $77
ld [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 +369,12 @@ Audio2_PlaySound::
ld [hl], a
ld a, e
cp Ch5
- jr nz, .skipSweepDisable
+ ret nz
ld a, $8
ld [rNR10], a ; sweep off
-.skipSweepDisable
- ld a, c
- and a
- jp z, .playSoundCommon
- dec c
- jp .sfxChannelLoop
+ ret
-.stopAllAudio
+Audio2_StopAllAudio::
ld a, $80
ld [rNR52], a ; sound hardware on
ld [rNR30], a ; wave playback on
@@ -1652,13 +400,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,135 +414,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
- ld a, [rNR50]
- ld [wSavedVolume], a
- ld a, $77
- ld [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:
- dw $F82C ; C_
- dw $F89D ; C#
- dw $F907 ; D_
- dw $F96B ; D#
- dw $F9CA ; E_
- dw $FA23 ; F_
- dw $FA77 ; F#
- dw $FAC7 ; G_
- dw $FB12 ; G#
- dw $FB58 ; A_
- dw $FB9B ; A#
- dw $FBDA ; B_
diff --git a/audio/engine_3.asm b/audio/engine_3.asm
index 4085dd3c..2d4a30e3 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
- ld [rNR51], a
- ld [rNR30], a
- ld a, $80
- ld [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 $ff ; is this command a sound_ret?
- jp nz, Audio3_sound_call ; no
- 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
- ld [rNR30], a
- ld a, $80
- ld [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
- ld a, [rNR51]
- and [hl]
- ld [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]
- ld [rNR50], a
- xor a
- ld [wSavedVolume], a
-.skipCry
- ld hl, wChannelSoundIDs
- add hl, bc
- ld [hl], b
- ret
-
-Audio3_sound_call:
- cp $fd ; is this command a sound_call?
- jp nz, Audio3_sound_loop ; no
- 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 $fe ; is this command a sound_loop?
- jp nz, Audio3_note_type ; no
- 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 $d0 ; is this command a note_type?
- jp nz, Audio3_toggle_perfect_pitch ; no
- 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 $e8 ; is this command a toggle_perfect_pitch?
- jr nz, Audio3_vibrato ; no
- 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 $ea ; is this command a vibrato?
- jr nz, Audio3_pitch_slide ; no
- 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 $eb ; is this command a pitch_slide?
- jr nz, Audio3_duty_cycle ; no
- 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 $ec ; is this command a duty_cycle?
- jr nz, Audio3_tempo ; no
- 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 $ed ; is this command a tempo?
- jr nz, Audio3_stereo_panning ; no
- 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 $ee ; is this command a stereo_panning?
- jr nz, Audio3_unknownmusic0xef ; no
- call Audio3_GetNextMusicByte
- ld [wStereoPanning], a ; store panning
- jp Audio3_sound_ret
-
-; this appears to never be used
-Audio3_unknownmusic0xef:
- cp $ef ; is this command an unknownmusic0xef?
- jr nz, Audio3_duty_cycle_pattern ; no
- 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 $fc ; is this command a duty_cycle_pattern?
- jr nz, Audio3_volume ; no
- 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 $f0 ; is this command a volume?
- jr nz, Audio3_execute_music ; no
- call Audio3_GetNextMusicByte
- ld [rNR50], a ; store volume
- jp Audio3_sound_ret
-
-Audio3_execute_music:
- cp $f8 ; is this command an execute_music?
- jr nz, Audio3_octave ; no
- ld b, $0
- ld hl, wChannelFlags2
- add hl, bc
- set BIT_EXECUTE_MUSIC, [hl]
- jp Audio3_sound_ret
-
-Audio3_octave:
- and $f0
- cp $e0 ; is this command an octave?
- jr nz, Audio3_sfx_note ; no
- 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 $20 ; is this command a sfx_note?
- 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 $10 ; is this command a pitch_sweep?
- jr nz, Audio3_note ; no
- ld b, $0
- ld hl, wChannelFlags2
- add hl, bc
- bit BIT_EXECUTE_MUSIC, [hl]
- jr nz, Audio3_note ; no
- call Audio3_GetNextMusicByte
- ld [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 $b0 ; is this command a drum_note?
- jr z, .drum_note
- jr nc, Audio3_note_length ; no
-
- ; this executes when on the noise channel and
- ; the command id is less than $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 $c0 ; compare to rest
- 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
- ld a, [rNR51]
- and [hl]
- ld [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
- ld 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
- ld 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
- ld [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, $ff30 ; wave pattern RAM
- ld b, $f
- ld a, $0 ; stop hardware channel 3
- ld [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
- ld [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
-
Audio3_PlaySound::
ld [wSoundID], a
+ ld a, [wSoundID]
cp $ff
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, $8
- ld hl, wChannelReturnAddresses
- call .FillMem
- ld hl, wChannelCommandPointers
- call .FillMem
- ld d, $4
- 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
- ld [rNR50], a
- ld a, $8
- ld [rNR10], a
- ld a, 0
- ld [rNR51], a
- xor a
- ld [rNR30], a
- ld a, $80
- ld [rNR30], a
- ld a, $77
- ld [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
- ld [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
- ld [rNR52], a ; sound hardware on
- ld [rNR30], a ; wave playback on
- xor a
- ld [rNR51], a ; no sound output
- ld [rNR32], a ; mute channel 3 (wave channel)
- ld a, $8
- ld [rNR10], a ; sweep off
- ld [rNR12], a ; mute channel 1 (pulse channel 1)
- ld [rNR22], a ; mute channel 2 (pulse channel 2)
- ld [rNR42], a ; mute channel 4 (noise channel)
- ld a, $40
- ld [rNR14], a ; counter mode
- ld [rNR24], a
- ld [rNR44], a
- ld a, $77
- ld [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,30 +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:
- dw $F82C ; C_
- dw $F89D ; C#
- dw $F907 ; D_
- dw $F96B ; D#
- dw $F9CA ; E_
- dw $FA23 ; F_
- dw $FA77 ; F#
- dw $FAC7 ; G_
- dw $FB12 ; G#
- dw $FB58 ; A_
- dw $FB9B ; A#
- dw $FBDA ; B_
diff --git a/audio/engine_4.asm b/audio/engine_4.asm
new file mode 100644
index 00000000..2f0d9ade
--- /dev/null
+++ b/audio/engine_4.asm
@@ -0,0 +1,191 @@
+; The fourth of three 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
+ ld a, [rNR50]
+ ld [wSavedVolume], a
+ ld a, $77
+ ld [rNR50], a ; full volume
+.done
+ ret
+
+Audio4_CryRet:
+ sound_ret
diff --git a/audio/headers/musicheaders1.asm b/audio/headers/musicheaders1.asm
index ef85eae6..ef85eae6 100755..100644
--- a/audio/headers/musicheaders1.asm
+++ b/audio/headers/musicheaders1.asm
diff --git a/audio/headers/musicheaders2.asm b/audio/headers/musicheaders2.asm
index d6cca9a9..d6cca9a9 100755..100644
--- a/audio/headers/musicheaders2.asm
+++ b/audio/headers/musicheaders2.asm
diff --git a/audio/headers/musicheaders3.asm b/audio/headers/musicheaders3.asm
index ca21b419..51c67966 100755..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/sfxheaders1.asm b/audio/headers/sfxheaders1.asm
index 2d5eca4a..de0d3b89 100644
--- a/audio/headers/sfxheaders1.asm
+++ b/audio/headers/sfxheaders1.asm
@@ -1,5 +1,5 @@
SFX_Headers_1::
- db $ff, $ff, $ff ; padding
+ dbw -1, -1 ; padding
SFX_Noise_Instrument01_1::
audio_header SFX_Noise_Instrument01_1, Ch8
diff --git a/audio/headers/sfxheaders2.asm b/audio/headers/sfxheaders2.asm
index 912d137e..eb8eb4c1 100644
--- a/audio/headers/sfxheaders2.asm
+++ b/audio/headers/sfxheaders2.asm
@@ -1,5 +1,5 @@
SFX_Headers_2::
- db $ff, $ff, $ff ; padding
+ dbw -1, -1 ; padding
SFX_Noise_Instrument01_2::
audio_header SFX_Noise_Instrument01_2, Ch8
diff --git a/audio/headers/sfxheaders3.asm b/audio/headers/sfxheaders3.asm
index 2732767f..d1e0a127 100644
--- a/audio/headers/sfxheaders3.asm
+++ b/audio/headers/sfxheaders3.asm
@@ -1,5 +1,5 @@
SFX_Headers_3::
- db $ff, $ff, $ff ; padding
+ dbw -1, -1 ; padding
SFX_Noise_Instrument01_3::
audio_header SFX_Noise_Instrument01_3, Ch8
diff --git a/audio/headers/sfxheaders4.asm b/audio/headers/sfxheaders4.asm
new file mode 100644
index 00000000..c7f7e9d6
--- /dev/null
+++ b/audio/headers/sfxheaders4.asm
@@ -0,0 +1,212 @@
+SFX_Headers_4::
+ dbw -1, -1 ; 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_Unknown_805db::
+ audio_header SFX_Unknown_805db, Ch5, Ch6, Ch8
+
+SFX_Unknown_807eb::
+ audio_header SFX_Unknown_807eb, Ch5, Ch6, Ch8
+
+SFX_Unknown_80760::
+ audio_header SFX_Unknown_80760, Ch5, Ch6, Ch8
+
+SFX_Unknown_804fa::
+ audio_header SFX_Unknown_804fa, Ch5, Ch6, Ch8
+
+SFX_Unknown_808a9::
+ audio_header SFX_Unknown_808a9, Ch5, Ch6, Ch8
+
+SFX_Unknown_80689::
+ audio_header SFX_Unknown_80689, Ch5, Ch6, Ch8
+
+SFX_Unknown_80633::
+ audio_header SFX_Unknown_80633, Ch5, Ch6, Ch8
+
+SFX_Unknown_80661::
+ audio_header SFX_Unknown_80661, Ch5, Ch6, Ch8
+
+SFX_Unknown_80879::
+ audio_header SFX_Unknown_80879, Ch5, Ch6, Ch8
+
+SFX_Unknown_80383::
+ audio_header SFX_Unknown_80383, Ch5, Ch6, Ch8
+
+SFX_Unknown_8081e::
+ audio_header SFX_Unknown_8081e, Ch5, Ch6, Ch8
+
+SFX_Unknown_806af::
+ audio_header SFX_Unknown_806af, Ch5, Ch6, Ch8
+
+SFX_Unknown_80712::
+ audio_header SFX_Unknown_80712, Ch5, Ch6, Ch8
+
+SFX_Unknown_8077e::
+ audio_header SFX_Unknown_8077e, Ch5, Ch6, Ch8
+
+SFX_Unknown_80603::
+ audio_header SFX_Unknown_80603, Ch5, Ch6, Ch8
+
+SFX_Unknown_80545::
+ audio_header SFX_Unknown_80545, Ch5, Ch6, Ch8
+
+SFX_Unknown_8058b::
+ audio_header SFX_Unknown_8058b, Ch5, Ch6, Ch8
+
+SFX_Unknown_80467::
+ audio_header SFX_Unknown_80467, Ch5, Ch6, Ch8
+
+SFX_Unknown_8097f::
+ audio_header SFX_Unknown_8097f, Ch5, Ch6, Ch8
+
+SFX_Unknown_809b2::
+ audio_header SFX_Unknown_809b2, Ch5, Ch6, Ch8
+
+SFX_Unknown_809fb::
+ audio_header SFX_Unknown_809fb, Ch5, Ch6, Ch8
+
+SFX_Unknown_80a89::
+ audio_header SFX_Unknown_80a89, Ch5, Ch6, Ch8
+
+SFX_Unknown_8091c::
+ audio_header SFX_Unknown_8091c, Ch5, Ch6, Ch8
+
+SFX_Unknown_80ad2::
+ audio_header SFX_Unknown_80ad2, Ch5, Ch6, Ch8
+
+SFX_Unknown_80be2::
+ audio_header SFX_Unknown_80be2, Ch5, Ch6, Ch8
+
+SFX_Unknown_808fa::
+ audio_header SFX_Unknown_808fa, Ch5, Ch6, Ch8
+
+SFX_Unknown_80b53::
+ audio_header SFX_Unknown_80b53, Ch5, Ch6, Ch8
+
+SFX_Unknown_80944::
+ audio_header SFX_Unknown_80944, Ch5, Ch6, Ch8
+
+SFX_Unknown_80b05::
+ audio_header SFX_Unknown_80b05, Ch5, Ch6, Ch8
+
+SFX_Unknown_80b9c::
+ audio_header SFX_Unknown_80b9c, Ch5, Ch6, Ch8
+
+SFX_Unknown_80a23::
+ audio_header SFX_Unknown_80a23, Ch5, Ch6, Ch8
+
+SFX_Unknown_80c3b::
+ audio_header SFX_Unknown_80c3b, Ch5, Ch6, Ch8
+
+SFX_Unknown_80c6e::
+ audio_header SFX_Unknown_80c6e, Ch5, Ch6, Ch8
+
+SFX_Unknown_80ca1::
+ audio_header SFX_Unknown_80ca1, Ch5, Ch6, Ch8
+
+SFX_Unknown_80ce7::
+ audio_header SFX_Unknown_80ce7, Ch5, Ch6, Ch8
+
+SFX_Unknown_803da::
+ audio_header SFX_Unknown_803da, Ch5, Ch6, Ch8
+
+SFX_Unknown_80411::
+ audio_header SFX_Unknown_80411, Ch5, Ch6, Ch8
+
+SFX_Unknown_804bf::
+ audio_header SFX_Unknown_804bf, 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_Unknown_8027f::
+ audio_header SFX_Unknown_8027f, Ch5
+
+SFX_Unknown_8026a::
+ audio_header SFX_Unknown_8026a, Ch5
+
+SFX_Unknown_80263::
+ audio_header SFX_Unknown_80263, Ch8
+
+SFX_Surfing_Add_Points::
+ audio_header SFX_Surfing_Add_Points, Ch5
+
+SFX_Surfing_Jump::
+ audio_header SFX_Surfing_Jump, Ch8
+
+SFX_Surfing_Flip::
+ audio_header SFX_Surfing_Flip, Ch5
+
+SFX_Surfing_Land::
+ audio_header SFX_Surfing_Land, Ch8
+
+SFX_Unknown_802cc::
+ audio_header SFX_Unknown_802cc, Ch5
+
+SFX_Surfing_Crash::
+ audio_header SFX_Surfing_Crash, 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..6bcb1fc0 100644
--- a/audio/music/dungeon1.asm
+++ b/audio/music/dungeon1.asm
@@ -6,10 +6,10 @@ Music_Dungeon1_Ch1::
vibrato 10, 1, 4
note_type 12, 4, -5
rest 8
- stereo_panning %1110, %1101
+ ; stereo_panning %1110, %1101
octave 4
note F#, 8
- stereo_panning %1111, %1111
+ ; stereo_panning %1111, %1111
Music_Dungeon1_branch_7dee5::
note_type 12, 11, 2
diff --git a/audio/music/yellow/meetjessiejames.asm b/audio/music/meetjessiejames.asm
index d1f9f795..7f1f4598 100644
--- a/audio/music/yellow/meetjessiejames.asm
+++ b/audio/music/meetjessiejames.asm
@@ -306,3 +306,4 @@ Music_MeetJessieJames_branch_83235::
note E_, 1
rest 1
sound_loop 0, Music_MeetJessieJames_branch_83235
+ sound_ret
diff --git a/audio/music/printer.asm b/audio/music/printer.asm
new file mode 100755
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/yellow/surfingpikachu.asm b/audio/music/surfingpikachu.asm
index 8e161443..8e161443 100644
--- a/audio/music/yellow/surfingpikachu.asm
+++ b/audio/music/surfingpikachu.asm
diff --git a/audio/music/yellow/yellowintro.asm b/audio/music/yellowintro.asm
index bb741a22..bb741a22 100644
--- a/audio/music/yellow/yellowintro.asm
+++ b/audio/music/yellowintro.asm
diff --git a/audio/music/yellow/yellowunusedsong.asm b/audio/music/yellowunusedsong.asm
index f1e4d18f..f1e4d18f 100644
--- a/audio/music/yellow/yellowunusedsong.asm
+++ b/audio/music/yellowunusedsong.asm
diff --git a/audio/pikachu_cries.asm b/audio/pikachu_cries.asm
new file mode 100644
index 00000000..a09425b3
--- /dev/null
+++ b/audio/pikachu_cries.asm
@@ -0,0 +1,210 @@
+pcm: MACRO
+ dw .End - .Start
+.Start:
+\1
+.End:
+ENDM
+
+SECTION "Pikachu Cries 1", ROMX ; BANK $21
+
+PikachuCry1::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_1.pcm"
+ db $77 ; unused
+ ; All of the pcm data has one trailing byte that is never processed.
+
+PikachuCry2::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_2.pcm"
+ db $77 ; unused
+
+PikachuCry3::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_3.pcm"
+ db $03 ; unused
+
+PikachuCry4::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_4.pcm"
+ db $e0 ; unused
+
+
+SECTION "Pikachu Cries 2", ROMX ; BANK $22
+
+PikachuCry5::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_5.pcm"
+ db $77 ; unused
+
+PikachuCry6::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_6.pcm"
+ db $77 ; unused
+
+PikachuCry7::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_7.pcm"
+ db $ff ; unused
+
+
+SECTION "Pikachu Cries 3", ROMX ; BANK $23
+
+PikachuCry8::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_8.pcm"
+ db $f7 ; unused
+
+PikachuCry9::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_9.pcm"
+ db $f3 ; unused
+
+PikachuCry10::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_10.pcm"
+ db $ff ; unused
+
+
+SECTION "Pikachu Cries 4", ROMX ; BANK $24
+
+PikachuCry11::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_11.pcm"
+ db $77 ; unused
+
+PikachuCry12::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_12.pcm"
+ db $ff ; unused
+
+PikachuCry13::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_13.pcm"
+ db $f0 ; unused
+
+
+SECTION "Pikachu Cries 5", ROMX ; BANK $25
+
+PikachuCry14::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_14.pcm"
+ db $fc ; unused
+
+PikachuCry15::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_15.pcm"
+ db $77 ; unused
+
+SECTION "Pikachu Cries 6", ROMX ; BANK $31
+
+PikachuCry16::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_16.pcm"
+ db $e7 ; unused
+
+PikachuCry18::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_18.pcm"
+ db $00 ; unused
+
+PikachuCry22::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_22.pcm"
+ db $7e ; unused
+
+
+SECTION "Pikachu Cries 7", ROMX ; BANK $32
+
+PikachuCry20::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_20.pcm"
+ db $07 ; unused
+
+PikachuCry21::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_21.pcm"
+ db $ff ; unused
+
+
+SECTION "Pikachu Cries 8", ROMX ; BANK $33
+
+PikachuCry19::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_19.pcm"
+ db $06 ; unused
+
+PikachuCry24::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_24.pcm"
+ db $e0 ; unused
+
+PikachuCry26::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_26.pcm"
+ db $00 ; unused
+
+SECTION "Pikachu Cries 9", ROMX ; BANK $34
+
+PikachuCry17::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_17.pcm"
+ db $00 ; unused
+
+PikachuCry23::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_23.pcm"
+ db $00 ; unused
+
+PikachuCry25::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_25.pcm"
+ db $03 ; unused
+
+
+SECTION "Pikachu Cries 10", ROMX ; BANK $35
+
+PikachuCry27::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_27.pcm"
+ db $ff ; unused
+
+PikachuCry28::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_28.pcm"
+ db $1b ; unused
+
+PikachuCry29::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_29.pcm"
+ db $87 ; unused
+
+PikachuCry30::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_30.pcm"
+ db $00 ; unused
+
+PikachuCry31::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_31.pcm"
+ db $00 ; unused
+
+SECTION "Pikachu Cries 11", ROMX ; BANK $36
+
+PikachuCry32::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_32.pcm"
+ db $ff ; unused
+
+PikachuCry33::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_33.pcm"
+ db $1f ; unused
+
+PikachuCry34::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_34.pcm"
+ db $01 ; unused
+
+PikachuCry41::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_41.pcm"
+ db $9b ; unused
+
+
+SECTION "Pikachu Cries 12", ROMX ; BANK $37
+
+PikachuCry35::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_35.pcm"
+ db $00 ; unused
+
+PikachuCry36::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_36.pcm"
+ db $01 ; unused
+
+PikachuCry39::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_39.pcm"
+ db $0f ; unused
+
+
+SECTION "Pikachu Cries 13", ROMX ; BANK $38
+
+PikachuCry37::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_37.pcm"
+ db $3f ; unused
+
+PikachuCry38::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_38.pcm"
+ db $ff ; unused
+
+PikachuCry40::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_40.pcm"
+ db $ff ; unused
+
+PikachuCry42::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_42.pcm"
+ db $00 ; unused
diff --git a/audio/pikachu_cries/pikachu_cry_1.wav b/audio/pikachu_cries/pikachu_cry_1.wav
new file mode 100644
index 00000000..98714511
--- /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..e51a2979
--- /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..44eece5a
--- /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..cad90cfe
--- /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..981768b5
--- /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..3da9a543
--- /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..4ef874c3
--- /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..baddf17c
--- /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..f8bd9c73
--- /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..69b2d3b8
--- /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..a9429132
--- /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..d95343de
--- /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..1c1842e4
--- /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..d74ebc12
--- /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..89fa5c77
--- /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..ea092080
--- /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..ec51d8cb
--- /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..77dac608
--- /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..9a9a0776
--- /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..44a79ee0
--- /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..ccf8bde2
--- /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..fb3375b3
--- /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..d3423966
--- /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..9bdafdc2
--- /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..2853bc0b
--- /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..8ded504e
--- /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..9be38b10
--- /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..45986668
--- /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..91b4d35b
--- /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..789f9ca6
--- /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..bc004c25
--- /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..b7d23e25
--- /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..da02dee2
--- /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..8cfc1041
--- /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..a048a408
--- /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..bbf5eabd
--- /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..cd18baa0
--- /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..a2293acd
--- /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..814d7139
--- /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..6ffa781f
--- /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..04218660
--- /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..484c92bc
--- /dev/null
+++ b/audio/pikachu_cries/pikachu_cry_9.wav
Binary files differ
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_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/noise_instrument01_4.asm b/audio/sfx/noise_instrument01_4.asm
new file mode 100755
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 100755
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 100755
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/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/surfing_add_points.asm b/audio/sfx/surfing_add_points.asm
new file mode 100644
index 00000000..3eeed285
--- /dev/null
+++ b/audio/sfx/surfing_add_points.asm
@@ -0,0 +1,7 @@
+SFX_Surfing_Add_Points_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/surfing_crash.asm b/audio/sfx/surfing_crash.asm
new file mode 100644
index 00000000..e1af7f6a
--- /dev/null
+++ b/audio/sfx/surfing_crash.asm
@@ -0,0 +1,5 @@
+SFX_Surfing_Crash_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/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..41ece761
--- /dev/null
+++ b/audio/sfx/surfing_land.asm
@@ -0,0 +1,5 @@
+SFX_Surfing_Land_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/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 100755
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_80263.asm b/audio/sfx/unknown_80263.asm
new file mode 100755
index 00000000..e1be6dd5
--- /dev/null
+++ b/audio/sfx/unknown_80263.asm
@@ -0,0 +1,4 @@
+SFX_Unknown_80263_Ch8:
+ noise_note 1, 14, 2, 51
+ noise_note 8, 14, 1, 34
+ sound_ret
diff --git a/audio/sfx/unknown_8026a.asm b/audio/sfx/unknown_8026a.asm
new file mode 100644
index 00000000..c9ee20c4
--- /dev/null
+++ b/audio/sfx/unknown_8026a.asm
@@ -0,0 +1,9 @@
+SFX_Unknown_8026a_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/unknown_8027f.asm b/audio/sfx/unknown_8027f.asm
new file mode 100644
index 00000000..5fbb4618
--- /dev/null
+++ b/audio/sfx/unknown_8027f.asm
@@ -0,0 +1,7 @@
+SFX_Unknown_8027f_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/unknown_802cc.asm b/audio/sfx/unknown_802cc.asm
new file mode 100755
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/unknown_80337.asm b/audio/sfx/unknown_80337.asm
new file mode 100644
index 00000000..047dfaf4
--- /dev/null
+++ b/audio/sfx/unknown_80337.asm
@@ -0,0 +1,31 @@
+SFX_Unknown_80337_Ch5:
+ 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_Unknown_80337_Ch6:
+ 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_Unknown_80337_Ch8:
+ 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/sfx/unknown_80383.asm b/audio/sfx/unknown_80383.asm
new file mode 100644
index 00000000..a99c601b
--- /dev/null
+++ b/audio/sfx/unknown_80383.asm
@@ -0,0 +1,35 @@
+SFX_Unknown_80383_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_Unknown_80383_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_Unknown_80383_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/unknown_803da.asm b/audio/sfx/unknown_803da.asm
new file mode 100644
index 00000000..40fba1ca
--- /dev/null
+++ b/audio/sfx/unknown_803da.asm
@@ -0,0 +1,25 @@
+SFX_Unknown_803da_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_Unknown_803da_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_Unknown_803da_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/unknown_80411.asm b/audio/sfx/unknown_80411.asm
new file mode 100644
index 00000000..a6ba154b
--- /dev/null
+++ b/audio/sfx/unknown_80411.asm
@@ -0,0 +1,33 @@
+SFX_Unknown_80411_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_Unknown_80411_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_Unknown_80411_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/unknown_80467.asm b/audio/sfx/unknown_80467.asm
new file mode 100644
index 00000000..07fe1ca8
--- /dev/null
+++ b/audio/sfx/unknown_80467.asm
@@ -0,0 +1,34 @@
+SFX_Unknown_80467_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_Unknown_80467_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_Unknown_80467_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/unknown_804bf.asm b/audio/sfx/unknown_804bf.asm
new file mode 100644
index 00000000..a4e5c616
--- /dev/null
+++ b/audio/sfx/unknown_804bf.asm
@@ -0,0 +1,26 @@
+SFX_Unknown_804bf_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_Unknown_804bf_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_Unknown_804bf_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/unknown_804fa.asm b/audio/sfx/unknown_804fa.asm
new file mode 100644
index 00000000..0660ffd5
--- /dev/null
+++ b/audio/sfx/unknown_804fa.asm
@@ -0,0 +1,30 @@
+SFX_Unknown_804fa_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_Unknown_804fa_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_Unknown_804fa_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/unknown_80545.asm b/audio/sfx/unknown_80545.asm
new file mode 100644
index 00000000..ab819869
--- /dev/null
+++ b/audio/sfx/unknown_80545.asm
@@ -0,0 +1,29 @@
+SFX_Unknown_80545_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_Unknown_80545_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_Unknown_80545_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/unknown_8058b.asm b/audio/sfx/unknown_8058b.asm
new file mode 100644
index 00000000..b3082714
--- /dev/null
+++ b/audio/sfx/unknown_8058b.asm
@@ -0,0 +1,31 @@
+SFX_Unknown_8058b_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_Unknown_8058b_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_Unknown_8058b_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/unknown_805db.asm b/audio/sfx/unknown_805db.asm
new file mode 100644
index 00000000..7bb82004
--- /dev/null
+++ b/audio/sfx/unknown_805db.asm
@@ -0,0 +1,21 @@
+SFX_Unknown_805db_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_Unknown_805db_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_Unknown_805db_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/unknown_80603.asm b/audio/sfx/unknown_80603.asm
new file mode 100644
index 00000000..c673990c
--- /dev/null
+++ b/audio/sfx/unknown_80603.asm
@@ -0,0 +1,23 @@
+SFX_Unknown_80603_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_Unknown_80603_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_Unknown_80603_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/unknown_80633.asm b/audio/sfx/unknown_80633.asm
new file mode 100644
index 00000000..c2b421e1
--- /dev/null
+++ b/audio/sfx/unknown_80633.asm
@@ -0,0 +1,22 @@
+SFX_Unknown_80633_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_Unknown_80633_Ch6:
+ sound_ret
+
+
+SFX_Unknown_80633_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/unknown_80661.asm b/audio/sfx/unknown_80661.asm
new file mode 100644
index 00000000..e45a2b1f
--- /dev/null
+++ b/audio/sfx/unknown_80661.asm
@@ -0,0 +1,21 @@
+SFX_Unknown_80661_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_Unknown_80661_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_Unknown_80661_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/unknown_80689.asm b/audio/sfx/unknown_80689.asm
new file mode 100644
index 00000000..50e3d7dc
--- /dev/null
+++ b/audio/sfx/unknown_80689.asm
@@ -0,0 +1,19 @@
+SFX_Unknown_80689_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_Unknown_80689_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_Unknown_80689_Ch8:
+ sound_ret
diff --git a/audio/sfx/unknown_806af.asm b/audio/sfx/unknown_806af.asm
new file mode 100644
index 00000000..611b655a
--- /dev/null
+++ b/audio/sfx/unknown_806af.asm
@@ -0,0 +1,37 @@
+SFX_Unknown_806af_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_Unknown_806af_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_Unknown_806af_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/unknown_80712.asm b/audio/sfx/unknown_80712.asm
new file mode 100644
index 00000000..48d00508
--- /dev/null
+++ b/audio/sfx/unknown_80712.asm
@@ -0,0 +1,29 @@
+SFX_Unknown_80712_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_Unknown_80712_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_Unknown_80712_Ch8:
+ sound_ret
diff --git a/audio/sfx/unknown_80760.asm b/audio/sfx/unknown_80760.asm
new file mode 100644
index 00000000..4fd9eba2
--- /dev/null
+++ b/audio/sfx/unknown_80760.asm
@@ -0,0 +1,17 @@
+SFX_Unknown_80760_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_Unknown_80760_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_Unknown_80760_Ch8:
+ sound_ret
diff --git a/audio/sfx/unknown_8077e.asm b/audio/sfx/unknown_8077e.asm
new file mode 100644
index 00000000..c0ea51ad
--- /dev/null
+++ b/audio/sfx/unknown_8077e.asm
@@ -0,0 +1,40 @@
+SFX_Unknown_8077e_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_Unknown_8077e_Ch5
+ sound_ret
+
+
+SFX_Unknown_8077e_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_Unknown_8077e_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/unknown_807eb.asm b/audio/sfx/unknown_807eb.asm
new file mode 100644
index 00000000..c98628a0
--- /dev/null
+++ b/audio/sfx/unknown_807eb.asm
@@ -0,0 +1,24 @@
+SFX_Unknown_807eb_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_Unknown_807eb_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_Unknown_807eb_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/unknown_8081e.asm b/audio/sfx/unknown_8081e.asm
new file mode 100644
index 00000000..ca5e8aa1
--- /dev/null
+++ b/audio/sfx/unknown_8081e.asm
@@ -0,0 +1,35 @@
+SFX_Unknown_8081e_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_Unknown_8081e_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_Unknown_8081e_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/unknown_80879.asm b/audio/sfx/unknown_80879.asm
new file mode 100644
index 00000000..bbb4043e
--- /dev/null
+++ b/audio/sfx/unknown_80879.asm
@@ -0,0 +1,23 @@
+SFX_Unknown_80879_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_Unknown_80879_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_Unknown_80879_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/unknown_808a9.asm b/audio/sfx/unknown_808a9.asm
new file mode 100644
index 00000000..b27eeada
--- /dev/null
+++ b/audio/sfx/unknown_808a9.asm
@@ -0,0 +1,32 @@
+SFX_Unknown_808a9_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_Unknown_808a9_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_Unknown_808a9_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/unknown_808fa.asm b/audio/sfx/unknown_808fa.asm
new file mode 100644
index 00000000..37d49937
--- /dev/null
+++ b/audio/sfx/unknown_808fa.asm
@@ -0,0 +1,18 @@
+SFX_Unknown_808fa_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_Unknown_808fa_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_Unknown_808fa_Ch8:
+ sound_ret
diff --git a/audio/sfx/unknown_8091c.asm b/audio/sfx/unknown_8091c.asm
new file mode 100644
index 00000000..0d160799
--- /dev/null
+++ b/audio/sfx/unknown_8091c.asm
@@ -0,0 +1,21 @@
+SFX_Unknown_8091c_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_Unknown_8091c_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_Unknown_8091c_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/unknown_80944.asm b/audio/sfx/unknown_80944.asm
new file mode 100644
index 00000000..adfc42b2
--- /dev/null
+++ b/audio/sfx/unknown_80944.asm
@@ -0,0 +1,26 @@
+SFX_Unknown_80944_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_Unknown_80944_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_Unknown_80944_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/unknown_8097f.asm b/audio/sfx/unknown_8097f.asm
new file mode 100644
index 00000000..259b6b34
--- /dev/null
+++ b/audio/sfx/unknown_8097f.asm
@@ -0,0 +1,24 @@
+SFX_Unknown_8097f_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_Unknown_8097f_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_Unknown_8097f_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/unknown_809b2.asm b/audio/sfx/unknown_809b2.asm
new file mode 100644
index 00000000..08946ec9
--- /dev/null
+++ b/audio/sfx/unknown_809b2.asm
@@ -0,0 +1,30 @@
+SFX_Unknown_809b2_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_Unknown_809b2_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_Unknown_809b2_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/unknown_809fb.asm b/audio/sfx/unknown_809fb.asm
new file mode 100644
index 00000000..68edf2c9
--- /dev/null
+++ b/audio/sfx/unknown_809fb.asm
@@ -0,0 +1,21 @@
+SFX_Unknown_809fb_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_Unknown_809fb_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_Unknown_809fb_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/unknown_80a23.asm b/audio/sfx/unknown_80a23.asm
new file mode 100644
index 00000000..447ad7f3
--- /dev/null
+++ b/audio/sfx/unknown_80a23.asm
@@ -0,0 +1,38 @@
+SFX_Unknown_80a23_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_Unknown_80a23_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_Unknown_80a23_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/unknown_80a89.asm b/audio/sfx/unknown_80a89.asm
new file mode 100644
index 00000000..21a1d998
--- /dev/null
+++ b/audio/sfx/unknown_80a89.asm
@@ -0,0 +1,30 @@
+SFX_Unknown_80a89_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_Unknown_80a89_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_Unknown_80a89_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/unknown_80ad2.asm b/audio/sfx/unknown_80ad2.asm
new file mode 100644
index 00000000..ab114678
--- /dev/null
+++ b/audio/sfx/unknown_80ad2.asm
@@ -0,0 +1,24 @@
+SFX_Unknown_80ad2_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_Unknown_80ad2_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_Unknown_80ad2_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/unknown_80b05.asm b/audio/sfx/unknown_80b05.asm
new file mode 100644
index 00000000..e92fb103
--- /dev/null
+++ b/audio/sfx/unknown_80b05.asm
@@ -0,0 +1,31 @@
+SFX_Unknown_80b05_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_Unknown_80b05_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_Unknown_80b05_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/unknown_80b53.asm b/audio/sfx/unknown_80b53.asm
new file mode 100644
index 00000000..7645d225
--- /dev/null
+++ b/audio/sfx/unknown_80b53.asm
@@ -0,0 +1,30 @@
+SFX_Unknown_80b53_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_Unknown_80b53_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_Unknown_80b53_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/unknown_80b9c.asm b/audio/sfx/unknown_80b9c.asm
new file mode 100644
index 00000000..9e6bf047
--- /dev/null
+++ b/audio/sfx/unknown_80b9c.asm
@@ -0,0 +1,29 @@
+SFX_Unknown_80b9c_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_Unknown_80b9c_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_Unknown_80b9c_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/unknown_80be2.asm b/audio/sfx/unknown_80be2.asm
new file mode 100644
index 00000000..2efda306
--- /dev/null
+++ b/audio/sfx/unknown_80be2.asm
@@ -0,0 +1,34 @@
+SFX_Unknown_80be2_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_Unknown_80be2_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_Unknown_80be2_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/unknown_80c3b.asm b/audio/sfx/unknown_80c3b.asm
new file mode 100644
index 00000000..9eadefb9
--- /dev/null
+++ b/audio/sfx/unknown_80c3b.asm
@@ -0,0 +1,24 @@
+SFX_Unknown_80c3b_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_Unknown_80c3b_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_Unknown_80c3b_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/unknown_80c6e.asm b/audio/sfx/unknown_80c6e.asm
new file mode 100644
index 00000000..360ad173
--- /dev/null
+++ b/audio/sfx/unknown_80c6e.asm
@@ -0,0 +1,24 @@
+SFX_Unknown_80c6e_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_Unknown_80c6e_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_Unknown_80c6e_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/unknown_80ca1.asm b/audio/sfx/unknown_80ca1.asm
new file mode 100644
index 00000000..d42abd93
--- /dev/null
+++ b/audio/sfx/unknown_80ca1.asm
@@ -0,0 +1,27 @@
+SFX_Unknown_80ca1_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_Unknown_80ca1_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_Unknown_80ca1_Ch8:
+ sound_ret
diff --git a/audio/sfx/unknown_80ce7.asm b/audio/sfx/unknown_80ce7.asm
new file mode 100644
index 00000000..9c7706c2
--- /dev/null
+++ b/audio/sfx/unknown_80ce7.asm
@@ -0,0 +1,24 @@
+SFX_Unknown_80ce7_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_Unknown_80ce7_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_Unknown_80ce7_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/unknown_80e91.asm b/audio/sfx/unknown_80e91.asm
new file mode 100644
index 00000000..8db0a395
--- /dev/null
+++ b/audio/sfx/unknown_80e91.asm
@@ -0,0 +1,47 @@
+SFX_Unknown_80e91_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_Unknown_80e91_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_Unknown_80e91_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/unknown_832b9.bin b/audio/unknown_832b9.bin
new file mode 100755
index 00000000..1c14816a
--- /dev/null
+++ b/audio/unknown_832b9.bin
Binary files differ
diff --git a/audio/wave_instruments.asm b/audio/wave_instruments.asm
index fede06af..9f34d3ac 100644
--- a/audio/wave_instruments.asm
+++ b/audio/wave_instruments.asm
@@ -6,7 +6,7 @@
dw .wave5 ; used in the Lavender Town and Pokemon Tower themes
dw .wave5 ; unused
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 c8e5a78d..fa32422b 100644
--- a/constants.asm
+++ b/constants.asm
@@ -30,3 +30,4 @@ INCLUDE "constants/tilesets.asm"
INCLUDE "constants/starter_mons.asm"
INCLUDE "constants/event_constants.asm"
INCLUDE "constants/text_constants.asm"
+INCLUDE "constants/pikachu_emotion_constants.asm"
diff --git a/constants/credits_constants.asm b/constants/credits_constants.asm
index f5715072..013ceceb 100644
--- a/constants/credits_constants.asm
+++ b/constants/credits_constants.asm
@@ -1,67 +1,95 @@
-const_value = 0
-
- 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_def
+ 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
+const_value SET $fa
+ const CRED_THE_END
+ const CRED_COPYRIGHT
+ const CRED_TEXT
+ const CRED_TEXT_FADE
+ const CRED_TEXT_MON
+ const CRED_TEXT_FADE_MON
diff --git a/constants/event_constants.asm b/constants/event_constants.asm
index 5b73012b..b35f74f8 100755..100644
--- a/constants/event_constants.asm
+++ b/constants/event_constants.asm
@@ -5,7 +5,7 @@ const_value = 0
const EVENT_002 ; 002, (D747, bit 2)
const EVENT_HALL_OF_FAME_DEX_RATING ; 003, (D747, bit 3)
const EVENT_004 ; 004, (D747, bit 4)
- const EVENT_005 ; 005, (D747, bit 5)
+ const EVENT_PLAYER_AT_RIGHT_EXIT_TO_PALLET_TOWN ; 005, (D747, bit 5)
const EVENT_PALLET_AFTER_GETTING_POKEBALLS ; 006, (D747, bit 6)
const EVENT_007 ; 007, (D747, bit 7)
const EVENT_008 ; 008, (D748, bit 0)
@@ -168,7 +168,7 @@ const_value = 0
const EVENT_0A5 ; 0A5, (D75B, bit 5)
const EVENT_0A6 ; 0A6, (D75B, bit 6)
const EVENT_BEAT_CERULEAN_ROCKET_THIEF ; 0A7, (D75B, bit 7)
- const EVENT_0A8 ; 0A8, (D75C, bit 0)
+ const EVENT_GOT_BULBASAUR_IN_CERULEAN ; 0A8, (D75C, bit 0)
const EVENT_0A9 ; 0A9, (D75C, bit 1)
const EVENT_0AA ; 0AA, (D75C, bit 2)
const EVENT_0AB ; 0AB, (D75C, bit 3)
@@ -327,7 +327,7 @@ const_value = 0
const EVENT_144 ; 144, (D76F, bit 4)
const EVENT_145 ; 145, (D76F, bit 5)
const EVENT_146 ; 146, (D76F, bit 6)
- const EVENT_147 ; 147, (D76F, bit 7)
+ const EVENT_GOT_SQUIRTLE_FROM_OFFICER_JENNY ; 147, (D76F, bit 7)
const EVENT_148 ; 148, (D770, bit 0)
const EVENT_149 ; 149, (D770, bit 1)
const EVENT_14A ; 14A, (D770, bit 2)
@@ -1381,8 +1381,8 @@ const_value = 0
const EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_0 ; 562, (D7F3, bit 2)
const EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_1 ; 563, (D7F3, bit 3)
const EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_2 ; 564, (D7F3, bit 4)
- const EVENT_565 ; 565, (D7F3, bit 5)
- const EVENT_566 ; 566, (D7F3, bit 6)
+ const EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_3 ; 565, (D7F3, bit 5)
+ const EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_4 ; 566, (D7F3, bit 6)
const EVENT_567 ; 567, (D7F3, bit 7)
const EVENT_568 ; 568, (D7F4, bit 0)
const EVENT_569 ; 569, (D7F4, bit 1)
@@ -1400,13 +1400,13 @@ const_value = 0
const EVENT_BEAT_MT_MOON_1_TRAINER_4 ; 575, (D7F5, bit 5)
const EVENT_BEAT_MT_MOON_1_TRAINER_5 ; 576, (D7F5, bit 6)
const EVENT_BEAT_MT_MOON_1_TRAINER_6 ; 577, (D7F5, bit 7)
- const EVENT_578 ; 578, (D7F6, bit 0)
+ const EVENT_GOT_DOME_FOSSIL ; 578, (D7F6, bit 0)
const EVENT_BEAT_MT_MOON_EXIT_SUPER_NERD ; 579, (D7F6, bit 1)
const EVENT_BEAT_MT_MOON_3_TRAINER_0 ; 57A, (D7F6, bit 2)
const EVENT_BEAT_MT_MOON_3_TRAINER_1 ; 57B, (D7F6, bit 3)
const EVENT_BEAT_MT_MOON_3_TRAINER_2 ; 57C, (D7F6, bit 4)
const EVENT_BEAT_MT_MOON_3_TRAINER_3 ; 57D, (D7F6, bit 5)
- const EVENT_GOT_DOME_FOSSIL ; 57E, (D7F6, bit 6)
+ const EVENT_57E ; 57E, (D7F6, bit 6)
const EVENT_GOT_HELIX_FOSSIL ; 57F, (D7F6, bit 7)
const EVENT_580 ; 580, (D7F7, bit 0)
const EVENT_581 ; 581, (D7F7, bit 1)
@@ -2560,3 +2560,5 @@ const_value = 0
const EVENT_9FD ; 9FD, (D886, bit 5)
const EVENT_9FE ; 9FE, (D886, bit 6)
const EVENT_9FF ; 9FF, (D886, bit 7)
+
+NUM_EVENT_FLAGS EQU const_value
diff --git a/constants/hide_show_constants.asm b/constants/hide_show_constants.asm
index 805d16ec..de0addaf 100755
--- a/constants/hide_show_constants.asm
+++ b/constants/hide_show_constants.asm
@@ -1,78 +1,76 @@
; 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)
+; there may be unused sprites, but these will remain unmarked until
+; the disassembly is complete
-const_value = 0
+ 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_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 X
+ const HS_ROUTE_2_ITEM_2 ; 1B X
+ const HS_ROUTE_4_ITEM ; 1C X
+ const HS_ROUTE_9_ITEM ; 1D X
+ const HS_ROUTE_12_SNORLAX ; 1E
+ const HS_ROUTE_12_ITEM_1 ; 1F X
+ const HS_ROUTE_12_ITEM_2 ; 20 X
+ const HS_ROUTE_15_ITEM ; 21 X
+ 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 X
+ const HS_ROUTE_25_ITEM ; 27 X
+ 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 X
+ const HS_OLD_AMBER ; 33
+ const HS_CERULEAN_BULBASAUR ; 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_CERULEAN_CAVE_1F_ITEM_4 ; 38 X
+ const HS_POKEMON_TOWER_2F_RIVAL ; 39
+ const HS_POKEMON_TOWER_3F_ITEM ; 3A X
+ const HS_POKEMON_TOWER_4F_ITEM_1 ; 3B X
+ const HS_POKEMON_TOWER_4F_ITEM_2 ; 3C X
+ const HS_POKEMON_TOWER_4F_ITEM_3 ; 3D X
+ const HS_POKEMON_TOWER_5F_ITEM ; 3E X
+ const HS_POKEMON_TOWER_6F_ITEM_1 ; 3F X
+ const HS_POKEMON_TOWER_6F_ITEM_2 ; 40 X
+ 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
@@ -115,122 +113,133 @@ const_value = 0
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_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 X
+ const HS_MT_MOON_B2F_ITEM_2 ; 72 X
+ const HS_SS_ANNE_2F_RIVAL ; 73
+ const HS_SS_ANNE_1F_ROOMS_ITEM ; 74 X
+ const HS_SS_ANNE_2F_ROOMS_ITEM_1 ; 75 X
+ const HS_SS_ANNE_2F_ROOMS_ITEM_2 ; 76 X
+ const HS_SS_ANNE_B1F_ROOMS_ITEM_1 ; 77 X
+ const HS_SS_ANNE_B1F_ROOMS_ITEM_2 ; 78 X
+ const HS_SS_ANNE_B1F_ROOMS_ITEM_3 ; 79 X
+ const HS_VICTORY_ROAD_3F_ITEM_1 ; 7A X
+ const HS_VICTORY_ROAD_3F_ITEM_2 ; 7B X
+ const HS_VICTORY_ROAD_3F_BOULDER ; 7C
+ const HS_ROCKET_HIDEOUT_B1F_ITEM_1 ; 7D X
+ const HS_ROCKET_HIDEOUT_B1F_ITEM_2 ; 7E X
+ const HS_ROCKET_HIDEOUT_B2F_ITEM_1 ; 7F X
+ const HS_ROCKET_HIDEOUT_B2F_ITEM_2 ; 80 X
+ const HS_ROCKET_HIDEOUT_B2F_ITEM_3 ; 81 X
+ const HS_ROCKET_HIDEOUT_B2F_ITEM_4 ; 82 X
+ const HS_ROCKET_HIDEOUT_B3F_ITEM_1 ; 83 X
+ const HS_ROCKET_HIDEOUT_B3F_ITEM_2 ; 84 X
+ 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 X
+ const HS_ROCKET_HIDEOUT_B4F_ITEM_2 ; 89 X
+ const HS_ROCKET_HIDEOUT_B4F_ITEM_3 ; 8A X
+ 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 X
+ 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 X
+ const HS_SILPH_CO_4F_ITEM_2 ; 99 X
+ const HS_SILPH_CO_4F_ITEM_3 ; 9A X
+ 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 X
+ const HS_SILPH_CO_5F_ITEM_2 ; A0 X
+ const HS_SILPH_CO_5F_ITEM_3 ; A1 X
+ 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 X
+ const HS_SILPH_CO_6F_ITEM_2 ; A6 X
+ 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 X
+ const HS_SILPH_CO_7F_ITEM_2 ; AD X
+ 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 X
+ const HS_SILPH_CO_10F_ITEM_2 ; B9 X
+ const HS_SILPH_CO_10F_ITEM_3 ; BA X
+ 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 X
+ const HS_POKEMON_MANSION_3F_ITEM_1 ; C1 X
+ const HS_POKEMON_MANSION_3F_ITEM_2 ; C2 X
+ const HS_POKEMON_MANSION_B1F_ITEM_1 ; C3 X
+ const HS_POKEMON_MANSION_B1F_ITEM_2 ; C4 X
+ const HS_POKEMON_MANSION_B1F_ITEM_3 ; C5 X
+ const HS_POKEMON_MANSION_B1F_ITEM_4 ; C6 X
+ const HS_POKEMON_MANSION_B1F_ITEM_5 ; C7 X
+ const HS_SAFARI_ZONE_EAST_ITEM_1 ; C8 X
+ const HS_SAFARI_ZONE_EAST_ITEM_2 ; C9 X
+ const HS_SAFARI_ZONE_EAST_ITEM_3 ; CA X
+ const HS_SAFARI_ZONE_EAST_ITEM_4 ; CB X
+ const HS_SAFARI_ZONE_NORTH_ITEM_1 ; CC X
+ const HS_SAFARI_ZONE_NORTH_ITEM_2 ; CD X
+ const HS_SAFARI_ZONE_WEST_ITEM_1 ; CE X
+ const HS_SAFARI_ZONE_WEST_ITEM_2 ; CF X
+ const HS_SAFARI_ZONE_WEST_ITEM_3 ; D0 X
+ const HS_SAFARI_ZONE_WEST_ITEM_4 ; D1 X
+ const HS_SAFARI_ZONE_CENTER_ITEM ; D2 X
+ const HS_CERULEAN_CAVE_2F_ITEM_1 ; D3 X
+ const HS_CERULEAN_CAVE_2F_ITEM_2 ; D4 X
+ const HS_CERULEAN_CAVE_2F_ITEM_3 ; D5 X
+ const HS_CERULEAN_CAVE_2F_ITEM_4 ; D6 X
+ const HS_MEWTWO ; D7 X
+ const HS_CERULEAN_CAVE_B1F_ITEM_1 ; D8 X
+ const HS_CERULEAN_CAVE_B1F_ITEM_2 ; D9 X
+ const HS_CERULEAN_CAVE_B1F_ITEM_3 ; DA X
+ const HS_CERULEAN_CAVE_B1F_ITEM_4 ; DB X
+ const HS_VICTORY_ROAD_1F_ITEM_1 ; DC X
+ const HS_VICTORY_ROAD_1F_ITEM_2 ; DD X
+ 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 X
+ const HS_DAISY_SITTING_COPY ; EC
+ const HS_DAISY_WALKING_COPY ; ED
+ const HS_TOWN_MAP_COPY ; EE
diff --git a/constants/map_constants.asm b/constants/map_constants.asm
index 3ddc5746..cf006604 100644
--- a/constants/map_constants.asm
+++ b/constants/map_constants.asm
@@ -253,3 +253,4 @@ ENDM
mapconst LORELEIS_ROOM, 6, 5 ; $F5
mapconst BRUNOS_ROOM, 6, 5 ; $F6
mapconst AGATHAS_ROOM, 6, 5 ; $F7
+ mapconst BEACH_HOUSE, 4, 7 ; $F8
diff --git a/constants/misc_constants.asm b/constants/misc_constants.asm
index d6a935f8..bc8a767c 100644
--- a/constants/misc_constants.asm
+++ b/constants/misc_constants.asm
@@ -105,6 +105,11 @@ PARTY_TO_DAYCARE EQU 3
EXCLAMATION_BUBBLE EQU 0
QUESTION_BUBBLE EQU 1
SMILE_BUBBLE EQU 2
+SKULL_BUBBLE EQU 3
+HEART_BUBBLE EQU 4
+BOLT_BUBBLE EQU 5
+ZZZ_BUBBLE EQU 6
+FISH_BUBBLE EQU 7
; slot symbols
SLOTS7 EQU $0200
@@ -176,6 +181,8 @@ BIT_TEST_BATTLE EQU 0
BATTLE_TYPE_NORMAL EQU 0
BATTLE_TYPE_OLD_MAN EQU 1
BATTLE_TYPE_SAFARI EQU 2
+BATTLE_TYPE_RUN EQU 3
+BATTLE_TYPE_PIKACHU EQU 4
; serial
@@ -206,3 +213,26 @@ LINK_STATE_TRADING EQU $32 ; in a link trade
LINKBATTLE_RUN EQU $F
LINKBATTLE_STRUGGLE EQU $E
LINKBATTLE_NO_ACTION EQU $D
+
+; pikachu happiness modifiers
+const_value set 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
+
+; DMGPalToGBCPal
+CONVERT_BGP EQU 0
+CONVERT_OBP0 EQU 1
+CONVERT_OBP1 EQU 2
+
+NUM_COLORS EQU 4
+PAL_SIZE EQU NUM_COLORS * 2
+NUM_ACTIVE_PALS EQU 4
diff --git a/constants/music_constants.asm b/constants/music_constants.asm
index de91352e..bf37dea9 100644
--- a/constants/music_constants.asm
+++ b/constants/music_constants.asm
@@ -23,6 +23,7 @@ REG_FREQUENCY_LO EQU 3
MAX_SFX_ID_1 EQUS "SFX_SAFARI_ZONE_PA"
MAX_SFX_ID_2 EQUS "SFX_SILPH_SCOPE"
MAX_SFX_ID_3 EQUS "SFX_SHOOTING_STAR"
+MAX_SFX_ID_4 EQUS "SFX_GET_ITEM2_4_2 + 2"
NOISE_INSTRUMENTS_START EQUS "SFX_NOISE_INSTRUMENT01"
NOISE_INSTRUMENTS_END EQUS "SFX_NOISE_INSTRUMENT19 + 1"
@@ -91,7 +92,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
@@ -102,7 +103,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
music_const SFX_NOISE_INSTRUMENT01, SFX_Noise_Instrument01_1
music_const SFX_NOISE_INSTRUMENT02, SFX_Noise_Instrument02_1
music_const SFX_NOISE_INSTRUMENT03, SFX_Noise_Instrument03_1
@@ -160,8 +167,9 @@ ENDM
music_const SFX_CRY_23, SFX_Cry23_1
music_const SFX_CRY_24, SFX_Cry24_1
music_const SFX_CRY_25, SFX_Cry25_1
-
music_const SFX_GET_ITEM_2, SFX_Get_Item2_1
+
+ ; AUDIO_1 AUDIO_2 AUDIO_3
music_const SFX_TINK, SFX_Tink_1
music_const SFX_HEAL_HP, SFX_Heal_HP_1
music_const SFX_HEAL_AILMENT, SFX_Heal_Ailment_1
@@ -275,3 +283,12 @@ ENDM
music_const SFX_SLOTS_REWARD, SFX_Slots_Reward
music_const SFX_SLOTS_NEW_SPIN, SFX_Slots_New_Spin
music_const SFX_SHOOTING_STAR, SFX_Shooting_Star
+
+ ; AUDIO_4
+ music_const SFX_SURFING_ADD_POINTS, SFX_Surfing_Add_Points
+ music_const SFX_SURFING_JUMP, SFX_Surfing_Jump
+ music_const SFX_SURFING_FLIP, SFX_Surfing_Flip
+ music_const SFX_SURFING_LAND, SFX_Surfing_Land
+ music_const SFX_UNKNOWN_801BC_4, SFX_801bc_4
+ music_const SFX_SURFING_CRASH, SFX_Surfing_Crash
+ music_const SFX_GET_ITEM2_4_2, SFX_Get_Item2_4_2
diff --git a/constants/oam_constants.asm b/constants/oam_constants.asm
index 2d34048d..9eb52385 100755
--- a/constants/oam_constants.asm
+++ b/constants/oam_constants.asm
@@ -16,3 +16,18 @@ OAM_PRIORITY EQU 7 ; 0: OBJ above BG, 1: OBJ behind BG (colors 1-3)
OAM_HFLIP EQU 1 << OAM_X_FLIP ; horizontal flip
OAM_VFLIP EQU 1 << OAM_Y_FLIP ; vertical flip
OAM_BEHIND_BG EQU 1 << OAM_PRIORITY ; behind bg (except color 0)
+
+frame: MACRO
+ db \1
+x = \2
+REPT _NARG +- 2
+x = x | (\3 << 1)
+ shift
+endr
+ db x
+ endm
+
+delanim EQUS "db $fc"
+dorepeat EQUS "db $fd,"
+dorestart EQUS "db $fe"
+endanim EQUS "db $ff"
diff --git a/constants/palette_constants.asm b/constants/palette_constants.asm
index 1413ad98..0988b361 100755
--- a/constants/palette_constants.asm
+++ b/constants/palette_constants.asm
@@ -61,3 +61,6 @@ const_value = 0
const PAL_BADGE ; $22
const PAL_CAVE ; $23
const PAL_GAMEFREAK ; $24
+ const PAL_25 ; $25
+ const PAL_26 ; $26
+ const PAL_27 ; $27
diff --git a/constants/pikachu_emotion_constants.asm b/constants/pikachu_emotion_constants.asm
new file mode 100644
index 00000000..feb4a438
--- /dev/null
+++ b/constants/pikachu_emotion_constants.asm
@@ -0,0 +1,224 @@
+dpikapic: macro
+ db (\1_id - PikaPicAnimPointers) / 2
+ endm
+
+ldpikapic: macro
+ ld \1, (\2_id - PikaPicAnimPointers) / 2
+ endm
+
+dpikaemotion: macro
+ db (\1_id - PikachuEmotionTable) / 2
+ endm
+
+ldpikaemotion: macro
+ ld \1, (\2_id - PikachuEmotionTable) / 2
+ endm
+
+dpikaanim: macro
+ db (\1_id - PikaPicAnimBGFramesPointers) / 2
+ endm
+
+pikaframeend EQUS "db $e0"
+pikaframe: macro
+ db (\1_id - PikaPicTilemapPointers) / 2, \2
+ endm
+
+pikaframedelay EQUS "db 0,"
+
+; 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, \1
+ endm
+
+ const pikapic_loadgfx_command
+pikapic_loadgfx: macro
+ db pikapic_loadgfx_command, (\1_id - PikaPicAnimGFXHeaders) / 4
+ endm
+
+ const pikapic_animation_command
+pikapic_animation: macro
+ ; frameset pointer, starting vtile, y offset, x offset
+ db pikapic_animation_command
+ dpikaanim \1
+ 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, \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
+ dbw pikapic_jump_command, \1
+ endm
+
+ const pikapic_setduration_command
+pikapic_setduration: macro ; a
+ dbw pikapic_setduration_command, \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/sprite_constants.asm b/constants/sprite_constants.asm
index 11973648..3349e374 100755
--- a/constants/sprite_constants.asm
+++ b/constants/sprite_constants.asm
@@ -1,17 +1,17 @@
; pokemon's overworld sprites
const_value = 0
- const SPRITE_MON ; $0
- const SPRITE_BALL_M ; $1
- const SPRITE_HELIX ; $2
- const SPRITE_FAIRY ; $3
- const SPRITE_BIRD_M ; $4
- const SPRITE_WATER ; $5
- const SPRITE_BUG ; $6
- const SPRITE_GRASS ; $7
- const SPRITE_SNAKE ; $8
- const SPRITE_QUADRUPED ; $9
-
+ const SPRITE_MON ; $0
+ const SPRITE_BALL_M ; $1
+ const SPRITE_HELIX ; $2
+ const SPRITE_FAIRY ; $3
+ const SPRITE_BIRD_M ; $4
+ const SPRITE_WATER ; $5
+ const SPRITE_BUG ; $6
+ const SPRITE_GRASS ; $7
+ const SPRITE_SNAKE ; $8
+ const SPRITE_QUADRUPED ; $9
+ const SPRITE_PIKACHU_FAMILY ; $A
; overworld sprites
const_value = 1
@@ -45,7 +45,7 @@ const_value = 1
const SPRITE_MOM_GEISHA ; $1c
const SPRITE_BRUNETTE_GIRL ; $1d
const SPRITE_LANCE ; $1e
- const SPRITE_OAK_SCIENTIST_AIDE ; $1f
+ const SPRITE_UNUSED_1 ; $1f
const SPRITE_OAK_AIDE ; $20
const SPRITE_ROCKER ; $21
const SPRITE_SWIMMER ; $22
@@ -64,29 +64,41 @@ const_value = 1
const SPRITE_FISHER2 ; $2f
const SPRITE_BLACKBELT ; $30
const SPRITE_GUARD ; $31
- const SPRITE_COP_GUARD ; $32
+ const SPRITE_UNUSED_2 ; $32
const SPRITE_MOM ; $33
const SPRITE_BALDING_GUY ; $34
const SPRITE_YOUNG_BOY ; $35
- const SPRITE_GAMEBOY_KID ; $36
- const SPRITE_GAMEBOY_KID_COPY ; $37
+ const SPRITE_UNUSED_3 ; $36
+ const SPRITE_GAMEBOY_KID ; $37
const SPRITE_CLEFAIRY ; $38
const SPRITE_AGATHA ; $39
const SPRITE_BRUNO ; $3a
const SPRITE_LORELEI ; $3b
const SPRITE_SEEL ; $3c
- const SPRITE_BALL ; $3d
- const SPRITE_OMANYTE ; $3e
- const SPRITE_BOULDER ; $3f
- const SPRITE_PAPER_SHEET ; $40
- const SPRITE_BOOK_MAP_DEX ; $41
- const SPRITE_CLIPBOARD ; $42
- const SPRITE_SNORLAX ; $43
- const SPRITE_OLD_AMBER_COPY ; $44
- const SPRITE_OLD_AMBER ; $45
- const SPRITE_LYING_OLD_MAN_UNUSED_1 ; $46
- const SPRITE_LYING_OLD_MAN_UNUSED_2 ; $47
- const SPRITE_LYING_OLD_MAN ; $48
+ 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_2 ; $43
+ const SPRITE_CHANSEY ; $44
+ const SPRITE_JESSIE ; $45
+ const SPRITE_JAMES ; $46
+
+ ; 4-tile sprites
+ const SPRITE_BALL ; $47
+ const SPRITE_OMANYTE ; $48
+ const SPRITE_BOULDER ; $49
+ const SPRITE_PAPER_SHEET ; $4a
+ const SPRITE_BOOK_MAP_DEX ; $4b
+ const SPRITE_CLIPBOARD ; $4c
+ const SPRITE_SNORLAX ; $4d
+ const SPRITE_OLD_AMBER_COPY ; $4e
+ const SPRITE_OLD_AMBER ; $4f
+ const SPRITE_LYING_OLD_MAN_UNUSED_1 ; $50
+ const SPRITE_LYING_OLD_MAN_UNUSED_2 ; $51
+ const SPRITE_LYING_OLD_MAN ; $52
; different kinds of people events
ITEM EQU $80
diff --git a/constants/text_constants.asm b/constants/text_constants.asm
index 3cddce26..4479e90e 100644..100755
--- a/constants/text_constants.asm
+++ b/constants/text_constants.asm
@@ -3,6 +3,7 @@ TEXT_MON_FAINTED EQU $d0
TEXT_BLACKED_OUT EQU $d1
TEXT_REPEL_WORE_OFF EQU $d2
TEXT_SAFARI_GAME_OVER EQU $d3
+TEXT_PIKACHU_ANIM EQU $d4
; PrintNumber
BIT_MONEY_SIGN EQU 5
diff --git a/constants/tilesets.asm b/constants/tilesets.asm
index f10e4d92..aa81f774 100644
--- a/constants/tilesets.asm
+++ b/constants/tilesets.asm
@@ -24,3 +24,4 @@ const_value = 0
const CLUB ; 21
const FACILITY ; 22
const PLATEAU ; 23
+ const BEACH_HOUSE_TILESET ; 24
diff --git a/constants/trainer_constants.asm b/constants/trainer_constants.asm
index d936aa06..65b60cc5 100755
--- a/constants/trainer_constants.asm
+++ b/constants/trainer_constants.asm
@@ -8,50 +8,50 @@ ENDM
const_value = 1
- trainer_const YOUNGSTER ; $01
- trainer_const BUG_CATCHER ; $02
- trainer_const LASS ; $03
- trainer_const SAILOR ; $04
- trainer_const JR_TRAINER_M ; $05
- trainer_const JR_TRAINER_F ; $06
- trainer_const POKEMANIAC ; $07
- trainer_const SUPER_NERD ; $08
- trainer_const HIKER ; $09
- trainer_const BIKER ; $0A
- trainer_const BURGLAR ; $0B
- trainer_const ENGINEER ; $0C
- trainer_const JUGGLER_X ; $0D
- trainer_const FISHER ; $0E
- trainer_const SWIMMER ; $0F
- trainer_const CUE_BALL ; $10
- trainer_const GAMBLER ; $11
- trainer_const BEAUTY ; $12
- trainer_const PSYCHIC_TR ; $13
- trainer_const ROCKER ; $14
- trainer_const JUGGLER ; $15
- trainer_const TAMER ; $16
- trainer_const BIRD_KEEPER ; $17
- trainer_const BLACKBELT ; $18
- trainer_const SONY1 ; $19
- trainer_const PROF_OAK ; $1A
- trainer_const CHIEF ; $1B
- trainer_const SCIENTIST ; $1C
- trainer_const GIOVANNI ; $1D
- trainer_const ROCKET ; $1E
- trainer_const COOLTRAINER_M ; $1F
- trainer_const COOLTRAINER_F ; $20
- trainer_const BRUNO ; $21
- trainer_const BROCK ; $22
- trainer_const MISTY ; $23
- trainer_const LT_SURGE ; $24
- trainer_const ERIKA ; $25
- trainer_const KOGA ; $26
- trainer_const BLAINE ; $27
- trainer_const SABRINA ; $28
- trainer_const GENTLEMAN ; $29
- trainer_const SONY2 ; $2A
- trainer_const SONY3 ; $2B
- trainer_const LORELEI ; $2C
- trainer_const CHANNELER ; $2D
- trainer_const AGATHA ; $2E
- trainer_const LANCE ; $2F
+ trainer_const YOUNGSTER ; $01 | OPP = $C9
+ trainer_const BUG_CATCHER ; $02 | OPP = $CA
+ trainer_const LASS ; $03 | OPP = $CB
+ trainer_const SAILOR ; $04 | OPP = $CC
+ trainer_const JR_TRAINER_M ; $05 | OPP = $CD
+ trainer_const JR_TRAINER_F ; $06 | OPP = $CE
+ trainer_const POKEMANIAC ; $07 | OPP = $CF
+ trainer_const SUPER_NERD ; $08 | OPP = $D0
+ trainer_const HIKER ; $09 | OPP = $D1
+ trainer_const BIKER ; $0A | OPP = $D2
+ trainer_const BURGLAR ; $0B | OPP = $D3
+ trainer_const ENGINEER ; $0C | OPP = $D4
+ trainer_const JUGGLER_X ; $0D | OPP = $D5
+ trainer_const FISHER ; $0E | OPP = $D6
+ trainer_const SWIMMER ; $0F | OPP = $D7
+ trainer_const CUE_BALL ; $10 | OPP = $D8
+ trainer_const GAMBLER ; $11 | OPP = $D9
+ trainer_const BEAUTY ; $12 | OPP = $DA
+ trainer_const PSYCHIC_TR ; $13 | OPP = $DB
+ trainer_const ROCKER ; $14 | OPP = $DC
+ trainer_const JUGGLER ; $15 | OPP = $DD
+ trainer_const TAMER ; $16 | OPP = $DE
+ trainer_const BIRD_KEEPER ; $17 | OPP = $DF
+ trainer_const BLACKBELT ; $18 | OPP = $E0
+ trainer_const SONY1 ; $19 | OPP = $E1
+ trainer_const PROF_OAK ; $1A | OPP = $E2
+ trainer_const CHIEF ; $1B | OPP = $E3
+ trainer_const SCIENTIST ; $1C | OPP = $E4
+ trainer_const GIOVANNI ; $1D | OPP = $E5
+ trainer_const ROCKET ; $1E | OPP = $E6
+ trainer_const COOLTRAINER_M ; $1F | OPP = $E7
+ trainer_const COOLTRAINER_F ; $20 | OPP = $E8
+ trainer_const BRUNO ; $21 | OPP = $E9
+ trainer_const BROCK ; $22 | OPP = $EA
+ trainer_const MISTY ; $23 | OPP = $EB
+ trainer_const LT_SURGE ; $24 | OPP = $EC
+ trainer_const ERIKA ; $25 | OPP = $ED
+ trainer_const KOGA ; $26 | OPP = $EE
+ trainer_const BLAINE ; $27 | OPP = $EF
+ trainer_const SABRINA ; $28 | OPP = $F0
+ trainer_const GENTLEMAN ; $29 | OPP = $F1
+ trainer_const SONY2 ; $2A | OPP = $F2
+ trainer_const SONY3 ; $2B | OPP = $F3
+ trainer_const LORELEI ; $2C | OPP = $F4
+ trainer_const CHANNELER ; $2D | OPP = $F5
+ trainer_const AGATHA ; $2E | OPP = $F6
+ trainer_const LANCE ; $2F | OPP = $F7
diff --git a/data/animated_objects_3e_1.asm b/data/animated_objects_3e_1.asm
new file mode 100755
index 00000000..07b17ce5
--- /dev/null
+++ b/data/animated_objects_3e_1.asm
@@ -0,0 +1,383 @@
+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
+
+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/animated_objects_3e_2.asm b/data/animated_objects_3e_2.asm
new file mode 100755
index 00000000..4e9f5b3c
--- /dev/null
+++ b/data/animated_objects_3e_2.asm
@@ -0,0 +1,236 @@
+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
+
+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/animations.asm b/data/animations.asm
index 8c388afd..de2487d7 100755
--- a/data/animations.asm
+++ b/data/animations.asm
@@ -201,7 +201,6 @@ AttackAnimationPointers:
dw HidePicAnim
dw ThrowRockAnim
dw ThrowBaitAnim
- dw ZigZagScreenAnim
; each animation is a list of subanimations and special effects
; if first byte < $56
@@ -209,10 +208,6 @@ AttackAnimationPointers:
; if first byte >= $D8
; db special_effect_id, sound_id
; $FF terminated
-ZigZagScreenAnim:
- db SE_WAVY_SCREEN, $FF
- db $FF
-
PoundAnim:
StruggleAnim:
db $08,$00,$01
diff --git a/data/baseStats/abra.asm b/data/baseStats/abra.asm
index 1a41bb5c..c8e240f2 100644
--- a/data/baseStats/abra.asm
+++ b/data/baseStats/abra.asm
@@ -8,7 +8,7 @@ db PSYCHIC ; species type 1
db PSYCHIC ; species type 2
db 200 ; catch rate
db 73 ; base exp yield
-INCBIN "pic/bmon/abra.pic",0,1 ; 55, sprite dimensions
+INCBIN "pic/ymon/abra.pic",0,1 ; 55, sprite dimensions
dw AbraPicFront
dw AbraPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/aerodactyl.asm b/data/baseStats/aerodactyl.asm
index 874dd57d..7c9158f8 100644
--- a/data/baseStats/aerodactyl.asm
+++ b/data/baseStats/aerodactyl.asm
@@ -8,7 +8,7 @@ db ROCK ; species type 1
db FLYING ; species type 2
db 45 ; catch rate
db 202 ; base exp yield
-INCBIN "pic/bmon/aerodactyl.pic",0,1 ; 77, sprite dimensions
+INCBIN "pic/ymon/aerodactyl.pic",0,1 ; 77, sprite dimensions
dw AerodactylPicFront
dw AerodactylPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/alakazam.asm b/data/baseStats/alakazam.asm
index c20b6c41..5a9bf426 100644
--- a/data/baseStats/alakazam.asm
+++ b/data/baseStats/alakazam.asm
@@ -8,13 +8,13 @@ db PSYCHIC ; species type 1
db PSYCHIC ; species type 2
db 50 ; catch rate
db 186 ; base exp yield
-INCBIN "pic/bmon/alakazam.pic",0,1 ; 77, sprite dimensions
+INCBIN "pic/ymon/alakazam.pic",0,1 ; 77, sprite dimensions
dw AlakazamPicFront
dw AlakazamPicBack
; attacks known at lvl 0
db TELEPORT
-db CONFUSION
-db DISABLE
+db KINESIS
+db 0
db 0
db 3 ; growth rate
; learnset
diff --git a/data/baseStats/arbok.asm b/data/baseStats/arbok.asm
index 6beee569..1959af0c 100644
--- a/data/baseStats/arbok.asm
+++ b/data/baseStats/arbok.asm
@@ -8,7 +8,7 @@ db POISON ; species type 1
db POISON ; species type 2
db 90 ; catch rate
db 147 ; base exp yield
-INCBIN "pic/bmon/arbok.pic",0,1 ; 77, sprite dimensions
+INCBIN "pic/ymon/arbok.pic",0,1 ; 77, sprite dimensions
dw ArbokPicFront
dw ArbokPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/arcanine.asm b/data/baseStats/arcanine.asm
index 2a2dda3b..68e111a1 100644
--- a/data/baseStats/arcanine.asm
+++ b/data/baseStats/arcanine.asm
@@ -8,7 +8,7 @@ db FIRE ; species type 1
db FIRE ; species type 2
db 75 ; catch rate
db 213 ; base exp yield
-INCBIN "pic/bmon/arcanine.pic",0,1 ; 77, sprite dimensions
+INCBIN "pic/ymon/arcanine.pic",0,1 ; 77, sprite dimensions
dw ArcaninePicFront
dw ArcaninePicBack
; attacks known at lvl 0
diff --git a/data/baseStats/articuno.asm b/data/baseStats/articuno.asm
index ef791055..6171d40c 100644
--- a/data/baseStats/articuno.asm
+++ b/data/baseStats/articuno.asm
@@ -8,7 +8,7 @@ db ICE ; species type 1
db FLYING ; species type 2
db 3 ; catch rate
db 215 ; base exp yield
-INCBIN "pic/bmon/articuno.pic",0,1 ; 77, sprite dimensions
+INCBIN "pic/ymon/articuno.pic",0,1 ; 77, sprite dimensions
dw ArticunoPicFront
dw ArticunoPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/beedrill.asm b/data/baseStats/beedrill.asm
index 6bf091b8..859d4835 100644
--- a/data/baseStats/beedrill.asm
+++ b/data/baseStats/beedrill.asm
@@ -8,7 +8,7 @@ db BUG ; species type 1
db POISON ; species type 2
db 45 ; catch rate
db 159 ; base exp yield
-INCBIN "pic/bmon/beedrill.pic",0,1 ; 77, sprite dimensions
+INCBIN "pic/ymon/beedrill.pic",0,1 ; 77, sprite dimensions
dw BeedrillPicFront
dw BeedrillPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/bellsprout.asm b/data/baseStats/bellsprout.asm
index 1c908bbb..2126a422 100644
--- a/data/baseStats/bellsprout.asm
+++ b/data/baseStats/bellsprout.asm
@@ -8,7 +8,7 @@ db GRASS ; species type 1
db POISON ; species type 2
db 255 ; catch rate
db 84 ; base exp yield
-INCBIN "pic/bmon/bellsprout.pic",0,1 ; 55, sprite dimensions
+INCBIN "pic/ymon/bellsprout.pic",0,1 ; 55, sprite dimensions
dw BellsproutPicFront
dw BellsproutPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/blastoise.asm b/data/baseStats/blastoise.asm
index eaf18b41..c6fad5f0 100644
--- a/data/baseStats/blastoise.asm
+++ b/data/baseStats/blastoise.asm
@@ -8,7 +8,7 @@ db WATER ; species type 1
db WATER ; species type 2
db 45 ; catch rate
db 210 ; base exp yield
-INCBIN "pic/bmon/blastoise.pic",0,1 ; 77, sprite dimensions
+INCBIN "pic/ymon/blastoise.pic",0,1 ; 77, sprite dimensions
dw BlastoisePicFront
dw BlastoisePicBack
; attacks known at lvl 0
diff --git a/data/baseStats/bulbasaur.asm b/data/baseStats/bulbasaur.asm
index 7b3567b5..225e8bec 100644
--- a/data/baseStats/bulbasaur.asm
+++ b/data/baseStats/bulbasaur.asm
@@ -9,7 +9,7 @@ db GRASS ; species type 1
db POISON ; species type 2
db 45 ; catch rate
db 64 ; base exp yield
-INCBIN "pic/bmon/bulbasaur.pic",0,1 ; 55, sprite dimensions
+INCBIN "pic/ymon/bulbasaur.pic",0,1 ; 55, sprite dimensions
dw BulbasaurPicFront
dw BulbasaurPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/butterfree.asm b/data/baseStats/butterfree.asm
index c0fb5f6c..4b161422 100644
--- a/data/baseStats/butterfree.asm
+++ b/data/baseStats/butterfree.asm
@@ -8,7 +8,7 @@ db BUG ; species type 1
db FLYING ; species type 2
db 45 ; catch rate
db 160 ; base exp yield
-INCBIN "pic/bmon/butterfree.pic",0,1 ; 77, sprite dimensions
+INCBIN "pic/ymon/butterfree.pic",0,1 ; 77, sprite dimensions
dw ButterfreePicFront
dw ButterfreePicBack
; attacks known at lvl 0
@@ -24,5 +24,5 @@ db 0 ; growth rate
tmlearn 29,30,31,32
tmlearn 33,34,39
tmlearn 44,46
- tmlearn 50
+ tmlearn 50,55
db 0 ; padding
diff --git a/data/baseStats/caterpie.asm b/data/baseStats/caterpie.asm
index d26bc5d9..10615994 100644
--- a/data/baseStats/caterpie.asm
+++ b/data/baseStats/caterpie.asm
@@ -8,7 +8,7 @@ db BUG ; species type 1
db BUG ; species type 2
db 255 ; catch rate
db 53 ; base exp yield
-INCBIN "pic/bmon/caterpie.pic",0,1 ; 55, sprite dimensions
+INCBIN "pic/ymon/caterpie.pic",0,1 ; 55, sprite dimensions
dw CaterpiePicFront
dw CaterpiePicBack
; attacks known at lvl 0
diff --git a/data/baseStats/chansey.asm b/data/baseStats/chansey.asm
index 434b1c26..2097ef8c 100644
--- a/data/baseStats/chansey.asm
+++ b/data/baseStats/chansey.asm
@@ -8,12 +8,12 @@ db NORMAL ; species type 1
db NORMAL ; species type 2
db 30 ; catch rate
db 255 ; base exp yield
-INCBIN "pic/bmon/chansey.pic",0,1 ; 66, sprite dimensions
+INCBIN "pic/ymon/chansey.pic",0,1 ; 66, sprite dimensions
dw ChanseyPicFront
dw ChanseyPicBack
; attacks known at lvl 0
db POUND
-db DOUBLESLAP
+db TAIL_WHIP
db 0
db 0
db 4 ; growth rate
diff --git a/data/baseStats/charizard.asm b/data/baseStats/charizard.asm
index 2479a60c..c123bd18 100644
--- a/data/baseStats/charizard.asm
+++ b/data/baseStats/charizard.asm
@@ -8,7 +8,7 @@ db FIRE ; species type 1
db FLYING ; species type 2
db 45 ; catch rate
db 209 ; base exp yield
-INCBIN "pic/bmon/charizard.pic",0,1 ; 77, sprite dimensions
+INCBIN "pic/ymon/charizard.pic",0,1 ; 77, sprite dimensions
dw CharizardPicFront
dw CharizardPicBack
; attacks known at lvl 0
@@ -24,5 +24,5 @@ db 3 ; growth rate
tmlearn 26,27,28,31,32
tmlearn 33,34,38,39,40
tmlearn 44
- tmlearn 50,51,54
+ tmlearn 50,51,52,54
db 0 ; padding
diff --git a/data/baseStats/charmander.asm b/data/baseStats/charmander.asm
index ccd53458..2e0189f2 100644
--- a/data/baseStats/charmander.asm
+++ b/data/baseStats/charmander.asm
@@ -8,7 +8,7 @@ db FIRE ; species type 1
db FIRE ; species type 2
db 45 ; catch rate
db 65 ; base exp yield
-INCBIN "pic/bmon/charmander.pic",0,1 ; 55, sprite dimensions
+INCBIN "pic/ymon/charmander.pic",0,1 ; 55, sprite dimensions
dw CharmanderPicFront
dw CharmanderPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/charmeleon.asm b/data/baseStats/charmeleon.asm
index 80aa2bca..419fc4b8 100644
--- a/data/baseStats/charmeleon.asm
+++ b/data/baseStats/charmeleon.asm
@@ -8,7 +8,7 @@ db FIRE ; species type 1
db FIRE ; species type 2
db 45 ; catch rate
db 142 ; base exp yield
-INCBIN "pic/bmon/charmeleon.pic",0,1 ; 66, sprite dimensions
+INCBIN "pic/ymon/charmeleon.pic",0,1 ; 66, sprite dimensions
dw CharmeleonPicFront
dw CharmeleonPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/clefable.asm b/data/baseStats/clefable.asm
index 17837da4..473564b3 100644
--- a/data/baseStats/clefable.asm
+++ b/data/baseStats/clefable.asm
@@ -8,7 +8,7 @@ db NORMAL ; species type 1
db NORMAL ; species type 2
db 25 ; catch rate
db 129 ; base exp yield
-INCBIN "pic/bmon/clefable.pic",0,1 ; 66, sprite dimensions
+INCBIN "pic/ymon/clefable.pic",0,1 ; 66, sprite dimensions
dw ClefablePicFront
dw ClefablePicBack
; attacks known at lvl 0
diff --git a/data/baseStats/clefairy.asm b/data/baseStats/clefairy.asm
index 952391c7..c24f0c73 100644
--- a/data/baseStats/clefairy.asm
+++ b/data/baseStats/clefairy.asm
@@ -8,7 +8,7 @@ db NORMAL ; species type 1
db NORMAL ; species type 2
db 150 ; catch rate
db 68 ; base exp yield
-INCBIN "pic/bmon/clefairy.pic",0,1 ; 55, sprite dimensions
+INCBIN "pic/ymon/clefairy.pic",0,1 ; 55, sprite dimensions
dw ClefairyPicFront
dw ClefairyPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/cloyster.asm b/data/baseStats/cloyster.asm
index 10f38bdb..4b174241 100644
--- a/data/baseStats/cloyster.asm
+++ b/data/baseStats/cloyster.asm
@@ -8,7 +8,7 @@ db WATER ; species type 1
db ICE ; species type 2
db 60 ; catch rate
db 203 ; base exp yield
-INCBIN "pic/bmon/cloyster.pic",0,1 ; 77, sprite dimensions
+INCBIN "pic/ymon/cloyster.pic",0,1 ; 77, sprite dimensions
dw CloysterPicFront
dw CloysterPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/cubone.asm b/data/baseStats/cubone.asm
index b1222d98..598531d5 100644
--- a/data/baseStats/cubone.asm
+++ b/data/baseStats/cubone.asm
@@ -8,14 +8,14 @@ db GROUND ; species type 1
db GROUND ; species type 2
db 190 ; catch rate
db 87 ; base exp yield
-INCBIN "pic/bmon/cubone.pic",0,1 ; 55, sprite dimensions
+INCBIN "pic/ymon/cubone.pic",0,1 ; 55, sprite dimensions
dw CubonePicFront
dw CubonePicBack
; attacks known at lvl 0
-db BONE_CLUB
db GROWL
db 0
db 0
+db 0
db 0 ; growth rate
; learnset
tmlearn 1,5,6,8
diff --git a/data/baseStats/dewgong.asm b/data/baseStats/dewgong.asm
index fb0cf2c2..cdeb45a7 100644
--- a/data/baseStats/dewgong.asm
+++ b/data/baseStats/dewgong.asm
@@ -8,7 +8,7 @@ db WATER ; species type 1
db ICE ; species type 2
db 75 ; catch rate
db 176 ; base exp yield
-INCBIN "pic/bmon/dewgong.pic",0,1 ; 66, sprite dimensions
+INCBIN "pic/ymon/dewgong.pic",0,1 ; 66, sprite dimensions
dw DewgongPicFront
dw DewgongPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/diglett.asm b/data/baseStats/diglett.asm
index 8ef6e381..91fdc415 100644
--- a/data/baseStats/diglett.asm
+++ b/data/baseStats/diglett.asm
@@ -8,7 +8,7 @@ db GROUND ; species type 1
db GROUND ; species type 2
db 255 ; catch rate
db 81 ; base exp yield
-INCBIN "pic/bmon/diglett.pic",0,1 ; 55, sprite dimensions
+INCBIN "pic/ymon/diglett.pic",0,1 ; 55, sprite dimensions
dw DiglettPicFront
dw DiglettPicBack
; attacks known at lvl 0
@@ -24,5 +24,5 @@ db 0 ; growth rate
tmlearn 26,27,28,31,32
tmlearn 34
tmlearn 44,48
- tmlearn 50
+ tmlearn 50,51
db 0 ; padding
diff --git a/data/baseStats/ditto.asm b/data/baseStats/ditto.asm
index 90ea4c5e..456639c7 100644
--- a/data/baseStats/ditto.asm
+++ b/data/baseStats/ditto.asm
@@ -8,7 +8,7 @@ db NORMAL ; species type 1
db NORMAL ; species type 2
db 35 ; catch rate
db 61 ; base exp yield
-INCBIN "pic/bmon/ditto.pic",0,1 ; 55, sprite dimensions
+INCBIN "pic/ymon/ditto.pic",0,1 ; 55, sprite dimensions
dw DittoPicFront
dw DittoPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/dodrio.asm b/data/baseStats/dodrio.asm
index 99608f48..dfae1713 100644
--- a/data/baseStats/dodrio.asm
+++ b/data/baseStats/dodrio.asm
@@ -8,7 +8,7 @@ db NORMAL ; species type 1
db FLYING ; species type 2
db 45 ; catch rate
db 158 ; base exp yield
-INCBIN "pic/bmon/dodrio.pic",0,1 ; 77, sprite dimensions
+INCBIN "pic/ymon/dodrio.pic",0,1 ; 77, sprite dimensions
dw DodrioPicFront
dw DodrioPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/doduo.asm b/data/baseStats/doduo.asm
index 760c258b..5571d09e 100644
--- a/data/baseStats/doduo.asm
+++ b/data/baseStats/doduo.asm
@@ -8,7 +8,7 @@ db NORMAL ; species type 1
db FLYING ; species type 2
db 190 ; catch rate
db 96 ; base exp yield
-INCBIN "pic/bmon/doduo.pic",0,1 ; 55, sprite dimensions
+INCBIN "pic/ymon/doduo.pic",0,1 ; 55, sprite dimensions
dw DoduoPicFront
dw DoduoPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/dragonair.asm b/data/baseStats/dragonair.asm
index 041300e0..6ec0031b 100644
--- a/data/baseStats/dragonair.asm
+++ b/data/baseStats/dragonair.asm
@@ -6,9 +6,9 @@ db 70 ; base speed
db 70 ; base special
db DRAGON ; species type 1
db DRAGON ; species type 2
-db 45 ; catch rate
+db 27 ; catch rate
db 144 ; base exp yield
-INCBIN "pic/bmon/dragonair.pic",0,1 ; 66, sprite dimensions
+INCBIN "pic/ymon/dragonair.pic",0,1 ; 66, sprite dimensions
dw DragonairPicFront
dw DragonairPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/dragonite.asm b/data/baseStats/dragonite.asm
index 442275b2..02ac0c9b 100644
--- a/data/baseStats/dragonite.asm
+++ b/data/baseStats/dragonite.asm
@@ -6,9 +6,9 @@ db 80 ; base speed
db 100 ; base special
db DRAGON ; species type 1
db FLYING ; species type 2
-db 45 ; catch rate
+db 9 ; catch rate
db 218 ; base exp yield
-INCBIN "pic/bmon/dragonite.pic",0,1 ; 77, sprite dimensions
+INCBIN "pic/ymon/dragonite.pic",0,1 ; 77, sprite dimensions
dw DragonitePicFront
dw DragonitePicBack
; attacks known at lvl 0
diff --git a/data/baseStats/dratini.asm b/data/baseStats/dratini.asm
index 5fb5c75d..c3c659a4 100644
--- a/data/baseStats/dratini.asm
+++ b/data/baseStats/dratini.asm
@@ -8,7 +8,7 @@ db DRAGON ; species type 1
db DRAGON ; species type 2
db 45 ; catch rate
db 67 ; base exp yield
-INCBIN "pic/bmon/dratini.pic",0,1 ; 55, sprite dimensions
+INCBIN "pic/ymon/dratini.pic",0,1 ; 55, sprite dimensions
dw DratiniPicFront
dw DratiniPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/drowzee.asm b/data/baseStats/drowzee.asm
index 452db1bc..132c1b5c 100644
--- a/data/baseStats/drowzee.asm
+++ b/data/baseStats/drowzee.asm
@@ -8,7 +8,7 @@ db PSYCHIC ; species type 1
db PSYCHIC ; species type 2
db 190 ; catch rate
db 102 ; base exp yield
-INCBIN "pic/bmon/drowzee.pic",0,1 ; 66, sprite dimensions
+INCBIN "pic/ymon/drowzee.pic",0,1 ; 66, sprite dimensions
dw DrowzeePicFront
dw DrowzeePicBack
; attacks known at lvl 0
diff --git a/data/baseStats/dugtrio.asm b/data/baseStats/dugtrio.asm
index c763680f..07f551a5 100644
--- a/data/baseStats/dugtrio.asm
+++ b/data/baseStats/dugtrio.asm
@@ -8,7 +8,7 @@ db GROUND ; species type 1
db GROUND ; species type 2
db 50 ; catch rate
db 153 ; base exp yield
-INCBIN "pic/bmon/dugtrio.pic",0,1 ; 66, sprite dimensions
+INCBIN "pic/ymon/dugtrio.pic",0,1 ; 66, sprite dimensions
dw DugtrioPicFront
dw DugtrioPicBack
; attacks known at lvl 0
@@ -24,5 +24,5 @@ db 0 ; growth rate
tmlearn 26,27,28,31,32
tmlearn 34
tmlearn 44,48
- tmlearn 50
+ tmlearn 50,51
db 0 ; padding
diff --git a/data/baseStats/eevee.asm b/data/baseStats/eevee.asm
index 51e36621..7e64bfd8 100644
--- a/data/baseStats/eevee.asm
+++ b/data/baseStats/eevee.asm
@@ -8,12 +8,12 @@ db NORMAL ; species type 1
db NORMAL ; species type 2
db 45 ; catch rate
db 92 ; base exp yield
-INCBIN "pic/bmon/eevee.pic",0,1 ; 55, sprite dimensions
+INCBIN "pic/ymon/eevee.pic",0,1 ; 55, sprite dimensions
dw EeveePicFront
dw EeveePicBack
; attacks known at lvl 0
db TACKLE
-db SAND_ATTACK
+db TAIL_WHIP
db 0
db 0
db 0 ; growth rate
diff --git a/data/baseStats/ekans.asm b/data/baseStats/ekans.asm
index b029a67c..a4385e9c 100644
--- a/data/baseStats/ekans.asm
+++ b/data/baseStats/ekans.asm
@@ -8,7 +8,7 @@ db POISON ; species type 1
db POISON ; species type 2
db 255 ; catch rate
db 62 ; base exp yield
-INCBIN "pic/bmon/ekans.pic",0,1 ; 55, sprite dimensions
+INCBIN "pic/ymon/ekans.pic",0,1 ; 55, sprite dimensions
dw EkansPicFront
dw EkansPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/electabuzz.asm b/data/baseStats/electabuzz.asm
index 4b44604e..8b85f12a 100644
--- a/data/baseStats/electabuzz.asm
+++ b/data/baseStats/electabuzz.asm
@@ -8,7 +8,7 @@ db ELECTRIC ; species type 1
db ELECTRIC ; species type 2
db 45 ; catch rate
db 156 ; base exp yield
-INCBIN "pic/bmon/electabuzz.pic",0,1 ; 66, sprite dimensions
+INCBIN "pic/ymon/electabuzz.pic",0,1 ; 66, sprite dimensions
dw ElectabuzzPicFront
dw ElectabuzzPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/electrode.asm b/data/baseStats/electrode.asm
index 1b292f2f..d6842241 100644
--- a/data/baseStats/electrode.asm
+++ b/data/baseStats/electrode.asm
@@ -8,7 +8,7 @@ db ELECTRIC ; species type 1
db ELECTRIC ; species type 2
db 60 ; catch rate
db 150 ; base exp yield
-INCBIN "pic/bmon/electrode.pic",0,1 ; 55, sprite dimensions
+INCBIN "pic/ymon/electrode.pic",0,1 ; 55, sprite dimensions
dw ElectrodePicFront
dw ElectrodePicBack
; attacks known at lvl 0
diff --git a/data/baseStats/exeggcute.asm b/data/baseStats/exeggcute.asm
index 8503889b..db0860fa 100644
--- a/data/baseStats/exeggcute.asm
+++ b/data/baseStats/exeggcute.asm
@@ -8,7 +8,7 @@ db GRASS ; species type 1
db PSYCHIC ; species type 2
db 90 ; catch rate
db 98 ; base exp yield
-INCBIN "pic/bmon/exeggcute.pic",0,1 ; 77, sprite dimensions
+INCBIN "pic/ymon/exeggcute.pic",0,1 ; 77, sprite dimensions
dw ExeggcutePicFront
dw ExeggcutePicBack
; attacks known at lvl 0
diff --git a/data/baseStats/exeggutor.asm b/data/baseStats/exeggutor.asm
index 4d739430..1349e7d7 100644
--- a/data/baseStats/exeggutor.asm
+++ b/data/baseStats/exeggutor.asm
@@ -8,7 +8,7 @@ db GRASS ; species type 1
db PSYCHIC ; species type 2
db 45 ; catch rate
db 212 ; base exp yield
-INCBIN "pic/bmon/exeggutor.pic",0,1 ; 77, sprite dimensions
+INCBIN "pic/ymon/exeggutor.pic",0,1 ; 77, sprite dimensions
dw ExeggutorPicFront
dw ExeggutorPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/farfetchd.asm b/data/baseStats/farfetchd.asm
index 2aa7eca0..801b672c 100644
--- a/data/baseStats/farfetchd.asm
+++ b/data/baseStats/farfetchd.asm
@@ -8,7 +8,7 @@ db NORMAL ; species type 1
db FLYING ; species type 2
db 45 ; catch rate
db 94 ; base exp yield
-INCBIN "pic/bmon/farfetchd.pic",0,1 ; 66, sprite dimensions
+INCBIN "pic/ymon/farfetchd.pic",0,1 ; 66, sprite dimensions
dw FarfetchdPicFront
dw FarfetchdPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/fearow.asm b/data/baseStats/fearow.asm
index 4ad88723..2da5d712 100644
--- a/data/baseStats/fearow.asm
+++ b/data/baseStats/fearow.asm
@@ -8,7 +8,7 @@ db NORMAL ; species type 1
db FLYING ; species type 2
db 90 ; catch rate
db 162 ; base exp yield
-INCBIN "pic/bmon/fearow.pic",0,1 ; 77, sprite dimensions
+INCBIN "pic/ymon/fearow.pic",0,1 ; 77, sprite dimensions
dw FearowPicFront
dw FearowPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/flareon.asm b/data/baseStats/flareon.asm
index 70621a6a..82add9d7 100644
--- a/data/baseStats/flareon.asm
+++ b/data/baseStats/flareon.asm
@@ -8,12 +8,12 @@ db FIRE ; species type 1
db FIRE ; species type 2
db 45 ; catch rate
db 198 ; base exp yield
-INCBIN "pic/bmon/flareon.pic",0,1 ; 66, sprite dimensions
+INCBIN "pic/ymon/flareon.pic",0,1 ; 66, sprite dimensions
dw FlareonPicFront
dw FlareonPicBack
; attacks known at lvl 0
db TACKLE
-db SAND_ATTACK
+db TAIL_WHIP
db QUICK_ATTACK
db EMBER
db 0 ; growth rate
diff --git a/data/baseStats/gastly.asm b/data/baseStats/gastly.asm
index fdcaaa71..10f5eebd 100644
--- a/data/baseStats/gastly.asm
+++ b/data/baseStats/gastly.asm
@@ -8,7 +8,7 @@ db GHOST ; species type 1
db POISON ; species type 2
db 190 ; catch rate
db 95 ; base exp yield
-INCBIN "pic/bmon/gastly.pic",0,1 ; 77, sprite dimensions
+INCBIN "pic/ymon/gastly.pic",0,1 ; 77, sprite dimensions
dw GastlyPicFront
dw GastlyPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/gengar.asm b/data/baseStats/gengar.asm
index 0e3e877c..927e0d9b 100644
--- a/data/baseStats/gengar.asm
+++ b/data/baseStats/gengar.asm
@@ -8,7 +8,7 @@ db GHOST ; species type 1
db POISON ; species type 2
db 45 ; catch rate
db 190 ; base exp yield
-INCBIN "pic/bmon/gengar.pic",0,1 ; 66, sprite dimensions
+INCBIN "pic/ymon/gengar.pic",0,1 ; 66, sprite dimensions
dw GengarPicFront
dw GengarPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/geodude.asm b/data/baseStats/geodude.asm
index a47a993a..fb981766 100644
--- a/data/baseStats/geodude.asm
+++ b/data/baseStats/geodude.asm
@@ -8,7 +8,7 @@ db ROCK ; species type 1
db GROUND ; species type 2
db 255 ; catch rate
db 86 ; base exp yield
-INCBIN "pic/bmon/geodude.pic",0,1 ; 55, sprite dimensions
+INCBIN "pic/ymon/geodude.pic",0,1 ; 55, sprite dimensions
dw GeodudePicFront
dw GeodudePicBack
; attacks known at lvl 0
diff --git a/data/baseStats/gloom.asm b/data/baseStats/gloom.asm
index f2153e5c..35bfbba6 100644
--- a/data/baseStats/gloom.asm
+++ b/data/baseStats/gloom.asm
@@ -8,7 +8,7 @@ db GRASS ; species type 1
db POISON ; species type 2
db 120 ; catch rate
db 132 ; base exp yield
-INCBIN "pic/bmon/gloom.pic",0,1 ; 66, sprite dimensions
+INCBIN "pic/ymon/gloom.pic",0,1 ; 66, sprite dimensions
dw GloomPicFront
dw GloomPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/golbat.asm b/data/baseStats/golbat.asm
index 845adf4b..123ccad6 100644
--- a/data/baseStats/golbat.asm
+++ b/data/baseStats/golbat.asm
@@ -8,7 +8,7 @@ db POISON ; species type 1
db FLYING ; species type 2
db 90 ; catch rate
db 171 ; base exp yield
-INCBIN "pic/bmon/golbat.pic",0,1 ; 77, sprite dimensions
+INCBIN "pic/ymon/golbat.pic",0,1 ; 77, sprite dimensions
dw GolbatPicFront
dw GolbatPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/goldeen.asm b/data/baseStats/goldeen.asm
index ed3a4fdb..7952ec18 100644
--- a/data/baseStats/goldeen.asm
+++ b/data/baseStats/goldeen.asm
@@ -8,7 +8,7 @@ db WATER ; species type 1
db WATER ; species type 2
db 225 ; catch rate
db 111 ; base exp yield
-INCBIN "pic/bmon/goldeen.pic",0,1 ; 66, sprite dimensions
+INCBIN "pic/ymon/goldeen.pic",0,1 ; 66, sprite dimensions
dw GoldeenPicFront
dw GoldeenPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/golduck.asm b/data/baseStats/golduck.asm
index cce89da7..6ac14021 100644
--- a/data/baseStats/golduck.asm
+++ b/data/baseStats/golduck.asm
@@ -8,7 +8,7 @@ db WATER ; species type 1
db WATER ; species type 2
db 75 ; catch rate
db 174 ; base exp yield
-INCBIN "pic/bmon/golduck.pic",0,1 ; 77, sprite dimensions
+INCBIN "pic/ymon/golduck.pic",0,1 ; 77, sprite dimensions
dw GolduckPicFront
dw GolduckPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/golem.asm b/data/baseStats/golem.asm
index 28f2a326..5047de54 100644
--- a/data/baseStats/golem.asm
+++ b/data/baseStats/golem.asm
@@ -8,7 +8,7 @@ db ROCK ; species type 1
db GROUND ; species type 2
db 45 ; catch rate
db 177 ; base exp yield
-INCBIN "pic/bmon/golem.pic",0,1 ; 66, sprite dimensions
+INCBIN "pic/ymon/golem.pic",0,1 ; 66, sprite dimensions
dw GolemPicFront
dw GolemPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/graveler.asm b/data/baseStats/graveler.asm
index 08776ab1..898673b8 100644
--- a/data/baseStats/graveler.asm
+++ b/data/baseStats/graveler.asm
@@ -8,7 +8,7 @@ db ROCK ; species type 1
db GROUND ; species type 2
db 120 ; catch rate
db 134 ; base exp yield
-INCBIN "pic/bmon/graveler.pic",0,1 ; 66, sprite dimensions
+INCBIN "pic/ymon/graveler.pic",0,1 ; 66, sprite dimensions
dw GravelerPicFront
dw GravelerPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/grimer.asm b/data/baseStats/grimer.asm
index 5f7a64a7..0effddf4 100644
--- a/data/baseStats/grimer.asm
+++ b/data/baseStats/grimer.asm
@@ -8,7 +8,7 @@ db POISON ; species type 1
db POISON ; species type 2
db 190 ; catch rate
db 90 ; base exp yield
-INCBIN "pic/bmon/grimer.pic",0,1 ; 55, sprite dimensions
+INCBIN "pic/ymon/grimer.pic",0,1 ; 55, sprite dimensions
dw GrimerPicFront
dw GrimerPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/growlithe.asm b/data/baseStats/growlithe.asm
index df305636..39804054 100644
--- a/data/baseStats/growlithe.asm
+++ b/data/baseStats/growlithe.asm
@@ -8,7 +8,7 @@ db FIRE ; species type 1
db FIRE ; species type 2
db 190 ; catch rate
db 91 ; base exp yield
-INCBIN "pic/bmon/growlithe.pic",0,1 ; 55, sprite dimensions
+INCBIN "pic/ymon/growlithe.pic",0,1 ; 55, sprite dimensions
dw GrowlithePicFront
dw GrowlithePicBack
; attacks known at lvl 0
diff --git a/data/baseStats/gyarados.asm b/data/baseStats/gyarados.asm
index 6bfc34a0..742da527 100644
--- a/data/baseStats/gyarados.asm
+++ b/data/baseStats/gyarados.asm
@@ -8,14 +8,14 @@ db WATER ; species type 1
db FLYING ; species type 2
db 45 ; catch rate
db 214 ; base exp yield
-INCBIN "pic/bmon/gyarados.pic",0,1 ; 77, sprite dimensions
+INCBIN "pic/ymon/gyarados.pic",0,1 ; 77, sprite dimensions
dw GyaradosPicFront
dw GyaradosPicBack
; attacks known at lvl 0
-db BITE
-db DRAGON_RAGE
-db LEER
-db HYDRO_PUMP
+db TACKLE
+db 0
+db 0
+db 0
db 5 ; growth rate
; learnset
tmlearn 6,8
diff --git a/data/baseStats/haunter.asm b/data/baseStats/haunter.asm
index bd39eaf4..8614c373 100644
--- a/data/baseStats/haunter.asm
+++ b/data/baseStats/haunter.asm
@@ -8,7 +8,7 @@ db GHOST ; species type 1
db POISON ; species type 2
db 90 ; catch rate
db 126 ; base exp yield
-INCBIN "pic/bmon/haunter.pic",0,1 ; 66, sprite dimensions
+INCBIN "pic/ymon/haunter.pic",0,1 ; 66, sprite dimensions
dw HaunterPicFront
dw HaunterPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/hitmonchan.asm b/data/baseStats/hitmonchan.asm
index 37021f65..4a565d21 100644
--- a/data/baseStats/hitmonchan.asm
+++ b/data/baseStats/hitmonchan.asm
@@ -8,7 +8,7 @@ db FIGHTING ; species type 1
db FIGHTING ; species type 2
db 45 ; catch rate
db 140 ; base exp yield
-INCBIN "pic/bmon/hitmonchan.pic",0,1 ; 66, sprite dimensions
+INCBIN "pic/ymon/hitmonchan.pic",0,1 ; 66, sprite dimensions
dw HitmonchanPicFront
dw HitmonchanPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/hitmonlee.asm b/data/baseStats/hitmonlee.asm
index d16db130..b08cd76c 100644
--- a/data/baseStats/hitmonlee.asm
+++ b/data/baseStats/hitmonlee.asm
@@ -8,7 +8,7 @@ db FIGHTING ; species type 1
db FIGHTING ; species type 2
db 45 ; catch rate
db 139 ; base exp yield
-INCBIN "pic/bmon/hitmonlee.pic",0,1 ; 77, sprite dimensions
+INCBIN "pic/ymon/hitmonlee.pic",0,1 ; 77, sprite dimensions
dw HitmonleePicFront
dw HitmonleePicBack
; attacks known at lvl 0
diff --git a/data/baseStats/horsea.asm b/data/baseStats/horsea.asm
index 01de3ff6..86222be3 100644
--- a/data/baseStats/horsea.asm
+++ b/data/baseStats/horsea.asm
@@ -8,7 +8,7 @@ db WATER ; species type 1
db WATER ; species type 2
db 225 ; catch rate
db 83 ; base exp yield
-INCBIN "pic/bmon/horsea.pic",0,1 ; 55, sprite dimensions
+INCBIN "pic/ymon/horsea.pic",0,1 ; 55, sprite dimensions
dw HorseaPicFront
dw HorseaPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/hypno.asm b/data/baseStats/hypno.asm
index 4e4959b4..3d9cb355 100644
--- a/data/baseStats/hypno.asm
+++ b/data/baseStats/hypno.asm
@@ -8,7 +8,7 @@ db PSYCHIC ; species type 1
db PSYCHIC ; species type 2
db 75 ; catch rate
db 165 ; base exp yield
-INCBIN "pic/bmon/hypno.pic",0,1 ; 77, sprite dimensions
+INCBIN "pic/ymon/hypno.pic",0,1 ; 77, sprite dimensions
dw HypnoPicFront
dw HypnoPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/ivysaur.asm b/data/baseStats/ivysaur.asm
index 3e19f2a1..38d5ce6a 100644
--- a/data/baseStats/ivysaur.asm
+++ b/data/baseStats/ivysaur.asm
@@ -8,7 +8,7 @@ db GRASS ; species type 1
db POISON ; species type 2
db 45 ; catch rate
db 141 ; base exp yield
-INCBIN "pic/bmon/ivysaur.pic",0,1 ; 66, sprite dimensions
+INCBIN "pic/ymon/ivysaur.pic",0,1 ; 66, sprite dimensions
dw IvysaurPicFront
dw IvysaurPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/jigglypuff.asm b/data/baseStats/jigglypuff.asm
index fac03fc9..bb8a1626 100644
--- a/data/baseStats/jigglypuff.asm
+++ b/data/baseStats/jigglypuff.asm
@@ -8,7 +8,7 @@ db NORMAL ; species type 1
db NORMAL ; species type 2
db 170 ; catch rate
db 76 ; base exp yield
-INCBIN "pic/bmon/jigglypuff.pic",0,1 ; 55, sprite dimensions
+INCBIN "pic/ymon/jigglypuff.pic",0,1 ; 55, sprite dimensions
dw JigglypuffPicFront
dw JigglypuffPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/jolteon.asm b/data/baseStats/jolteon.asm
index b33d6327..dd1e3c5a 100644
--- a/data/baseStats/jolteon.asm
+++ b/data/baseStats/jolteon.asm
@@ -8,12 +8,12 @@ db ELECTRIC ; species type 1
db ELECTRIC ; species type 2
db 45 ; catch rate
db 197 ; base exp yield
-INCBIN "pic/bmon/jolteon.pic",0,1 ; 66, sprite dimensions
+INCBIN "pic/ymon/jolteon.pic",0,1 ; 66, sprite dimensions
dw JolteonPicFront
dw JolteonPicBack
; attacks known at lvl 0
db TACKLE
-db SAND_ATTACK
+db TAIL_WHIP
db QUICK_ATTACK
db THUNDERSHOCK
db 0 ; growth rate
diff --git a/data/baseStats/jynx.asm b/data/baseStats/jynx.asm
index e69b87b9..72d28179 100644
--- a/data/baseStats/jynx.asm
+++ b/data/baseStats/jynx.asm
@@ -8,7 +8,7 @@ db ICE ; species type 1
db PSYCHIC ; species type 2
db 45 ; catch rate
db 137 ; base exp yield
-INCBIN "pic/bmon/jynx.pic",0,1 ; 66, sprite dimensions
+INCBIN "pic/ymon/jynx.pic",0,1 ; 66, sprite dimensions
dw JynxPicFront
dw JynxPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/kabuto.asm b/data/baseStats/kabuto.asm
index 60f3e959..dce77f2b 100644
--- a/data/baseStats/kabuto.asm
+++ b/data/baseStats/kabuto.asm
@@ -8,7 +8,7 @@ db ROCK ; species type 1
db WATER ; species type 2
db 45 ; catch rate
db 119 ; base exp yield
-INCBIN "pic/bmon/kabuto.pic",0,1 ; 55, sprite dimensions
+INCBIN "pic/ymon/kabuto.pic",0,1 ; 55, sprite dimensions
dw KabutoPicFront
dw KabutoPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/kabutops.asm b/data/baseStats/kabutops.asm
index dbddab2e..ef165079 100644
--- a/data/baseStats/kabutops.asm
+++ b/data/baseStats/kabutops.asm
@@ -8,7 +8,7 @@ db ROCK ; species type 1
db WATER ; species type 2
db 45 ; catch rate
db 201 ; base exp yield
-INCBIN "pic/bmon/kabutops.pic",0,1 ; 66, sprite dimensions
+INCBIN "pic/ymon/kabutops.pic",0,1 ; 66, sprite dimensions
dw KabutopsPicFront
dw KabutopsPicBack
; attacks known at lvl 0
@@ -24,5 +24,5 @@ db 0 ; growth rate
tmlearn 31,32
tmlearn 33,34,40
tmlearn 44
- tmlearn 50,53
+ tmlearn 50,51,53
db 0 ; padding
diff --git a/data/baseStats/kadabra.asm b/data/baseStats/kadabra.asm
index 472cc4c5..37f9ded4 100644
--- a/data/baseStats/kadabra.asm
+++ b/data/baseStats/kadabra.asm
@@ -8,13 +8,13 @@ db PSYCHIC ; species type 1
db PSYCHIC ; species type 2
db 100 ; catch rate
db 145 ; base exp yield
-INCBIN "pic/bmon/kadabra.pic",0,1 ; 66, sprite dimensions
+INCBIN "pic/ymon/kadabra.pic",0,1 ; 66, sprite dimensions
dw KadabraPicFront
dw KadabraPicBack
; attacks known at lvl 0
db TELEPORT
-db CONFUSION
-db DISABLE
+db KINESIS
+db 0
db 0
db 3 ; growth rate
; learnset
diff --git a/data/baseStats/kakuna.asm b/data/baseStats/kakuna.asm
index ec593f91..ea59d67d 100644
--- a/data/baseStats/kakuna.asm
+++ b/data/baseStats/kakuna.asm
@@ -8,7 +8,7 @@ db BUG ; species type 1
db POISON ; species type 2
db 120 ; catch rate
db 71 ; base exp yield
-INCBIN "pic/bmon/kakuna.pic",0,1 ; 55, sprite dimensions
+INCBIN "pic/ymon/kakuna.pic",0,1 ; 55, sprite dimensions
dw KakunaPicFront
dw KakunaPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/kangaskhan.asm b/data/baseStats/kangaskhan.asm
index 6dcd1e3c..bca753e2 100644
--- a/data/baseStats/kangaskhan.asm
+++ b/data/baseStats/kangaskhan.asm
@@ -8,7 +8,7 @@ db NORMAL ; species type 1
db NORMAL ; species type 2
db 45 ; catch rate
db 175 ; base exp yield
-INCBIN "pic/bmon/kangaskhan.pic",0,1 ; 77, sprite dimensions
+INCBIN "pic/ymon/kangaskhan.pic",0,1 ; 77, sprite dimensions
dw KangaskhanPicFront
dw KangaskhanPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/kingler.asm b/data/baseStats/kingler.asm
index 8708d5cf..d4030bb8 100644
--- a/data/baseStats/kingler.asm
+++ b/data/baseStats/kingler.asm
@@ -8,7 +8,7 @@ db WATER ; species type 1
db WATER ; species type 2
db 60 ; catch rate
db 206 ; base exp yield
-INCBIN "pic/bmon/kingler.pic",0,1 ; 77, sprite dimensions
+INCBIN "pic/ymon/kingler.pic",0,1 ; 77, sprite dimensions
dw KinglerPicFront
dw KinglerPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/koffing.asm b/data/baseStats/koffing.asm
index fced6246..a6034ea6 100644
--- a/data/baseStats/koffing.asm
+++ b/data/baseStats/koffing.asm
@@ -8,7 +8,7 @@ db POISON ; species type 1
db POISON ; species type 2
db 190 ; catch rate
db 114 ; base exp yield
-INCBIN "pic/bmon/koffing.pic",0,1 ; 66, sprite dimensions
+INCBIN "pic/ymon/koffing.pic",0,1 ; 66, sprite dimensions
dw KoffingPicFront
dw KoffingPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/krabby.asm b/data/baseStats/krabby.asm
index 88d690b6..b0b6ce66 100644
--- a/data/baseStats/krabby.asm
+++ b/data/baseStats/krabby.asm
@@ -8,7 +8,7 @@ db WATER ; species type 1
db WATER ; species type 2
db 225 ; catch rate
db 115 ; base exp yield
-INCBIN "pic/bmon/krabby.pic",0,1 ; 55, sprite dimensions
+INCBIN "pic/ymon/krabby.pic",0,1 ; 55, sprite dimensions
dw KrabbyPicFront
dw KrabbyPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/lapras.asm b/data/baseStats/lapras.asm
index 3a897525..83df6278 100644
--- a/data/baseStats/lapras.asm
+++ b/data/baseStats/lapras.asm
@@ -8,7 +8,7 @@ db WATER ; species type 1
db ICE ; species type 2
db 45 ; catch rate
db 219 ; base exp yield
-INCBIN "pic/bmon/lapras.pic",0,1 ; 77, sprite dimensions
+INCBIN "pic/ymon/lapras.pic",0,1 ; 77, sprite dimensions
dw LaprasPicFront
dw LaprasPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/lickitung.asm b/data/baseStats/lickitung.asm
index 05020627..5db3fa6e 100644
--- a/data/baseStats/lickitung.asm
+++ b/data/baseStats/lickitung.asm
@@ -8,7 +8,7 @@ db NORMAL ; species type 1
db NORMAL ; species type 2
db 45 ; catch rate
db 127 ; base exp yield
-INCBIN "pic/bmon/lickitung.pic",0,1 ; 77, sprite dimensions
+INCBIN "pic/ymon/lickitung.pic",0,1 ; 77, sprite dimensions
dw LickitungPicFront
dw LickitungPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/machamp.asm b/data/baseStats/machamp.asm
index b461d45a..dec82c74 100644
--- a/data/baseStats/machamp.asm
+++ b/data/baseStats/machamp.asm
@@ -8,7 +8,7 @@ db FIGHTING ; species type 1
db FIGHTING ; species type 2
db 45 ; catch rate
db 193 ; base exp yield
-INCBIN "pic/bmon/machamp.pic",0,1 ; 77, sprite dimensions
+INCBIN "pic/ymon/machamp.pic",0,1 ; 77, sprite dimensions
dw MachampPicFront
dw MachampPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/machoke.asm b/data/baseStats/machoke.asm
index b8a41efd..eee41d0c 100644
--- a/data/baseStats/machoke.asm
+++ b/data/baseStats/machoke.asm
@@ -8,7 +8,7 @@ db FIGHTING ; species type 1
db FIGHTING ; species type 2
db 90 ; catch rate
db 146 ; base exp yield
-INCBIN "pic/bmon/machoke.pic",0,1 ; 77, sprite dimensions
+INCBIN "pic/ymon/machoke.pic",0,1 ; 77, sprite dimensions
dw MachokePicFront
dw MachokePicBack
; attacks known at lvl 0
diff --git a/data/baseStats/machop.asm b/data/baseStats/machop.asm
index 9ed22dc2..91250bfb 100644
--- a/data/baseStats/machop.asm
+++ b/data/baseStats/machop.asm
@@ -8,7 +8,7 @@ db FIGHTING ; species type 1
db FIGHTING ; species type 2
db 180 ; catch rate
db 88 ; base exp yield
-INCBIN "pic/bmon/machop.pic",0,1 ; 55, sprite dimensions
+INCBIN "pic/ymon/machop.pic",0,1 ; 55, sprite dimensions
dw MachopPicFront
dw MachopPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/magikarp.asm b/data/baseStats/magikarp.asm
index 50cc651c..941f8cd9 100644
--- a/data/baseStats/magikarp.asm
+++ b/data/baseStats/magikarp.asm
@@ -8,7 +8,7 @@ db WATER ; species type 1
db WATER ; species type 2
db 255 ; catch rate
db 20 ; base exp yield
-INCBIN "pic/bmon/magikarp.pic",0,1 ; 66, sprite dimensions
+INCBIN "pic/ymon/magikarp.pic",0,1 ; 66, sprite dimensions
dw MagikarpPicFront
dw MagikarpPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/magmar.asm b/data/baseStats/magmar.asm
index 379e91df..6d503611 100644
--- a/data/baseStats/magmar.asm
+++ b/data/baseStats/magmar.asm
@@ -8,7 +8,7 @@ db FIRE ; species type 1
db FIRE ; species type 2
db 45 ; catch rate
db 167 ; base exp yield
-INCBIN "pic/bmon/magmar.pic",0,1 ; 66, sprite dimensions
+INCBIN "pic/ymon/magmar.pic",0,1 ; 66, sprite dimensions
dw MagmarPicFront
dw MagmarPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/magnemite.asm b/data/baseStats/magnemite.asm
index ce042457..a328f2ef 100644
--- a/data/baseStats/magnemite.asm
+++ b/data/baseStats/magnemite.asm
@@ -8,7 +8,7 @@ db ELECTRIC ; species type 1
db ELECTRIC ; species type 2
db 190 ; catch rate
db 89 ; base exp yield
-INCBIN "pic/bmon/magnemite.pic",0,1 ; 55, sprite dimensions
+INCBIN "pic/ymon/magnemite.pic",0,1 ; 55, sprite dimensions
dw MagnemitePicFront
dw MagnemitePicBack
; attacks known at lvl 0
diff --git a/data/baseStats/magneton.asm b/data/baseStats/magneton.asm
index a2890bbd..9cc52ec3 100644
--- a/data/baseStats/magneton.asm
+++ b/data/baseStats/magneton.asm
@@ -8,7 +8,7 @@ db ELECTRIC ; species type 1
db ELECTRIC ; species type 2
db 60 ; catch rate
db 161 ; base exp yield
-INCBIN "pic/bmon/magneton.pic",0,1 ; 66, sprite dimensions
+INCBIN "pic/ymon/magneton.pic",0,1 ; 66, sprite dimensions
dw MagnetonPicFront
dw MagnetonPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/mankey.asm b/data/baseStats/mankey.asm
index 406a1364..b05fd16d 100644
--- a/data/baseStats/mankey.asm
+++ b/data/baseStats/mankey.asm
@@ -8,7 +8,7 @@ db FIGHTING ; species type 1
db FIGHTING ; species type 2
db 190 ; catch rate
db 74 ; base exp yield
-INCBIN "pic/bmon/mankey.pic",0,1 ; 55, sprite dimensions
+INCBIN "pic/ymon/mankey.pic",0,1 ; 55, sprite dimensions
dw MankeyPicFront
dw MankeyPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/marowak.asm b/data/baseStats/marowak.asm
index 3b90dbb1..bc767faf 100644
--- a/data/baseStats/marowak.asm
+++ b/data/baseStats/marowak.asm
@@ -8,14 +8,14 @@ db GROUND ; species type 1
db GROUND ; species type 2
db 75 ; catch rate
db 124 ; base exp yield
-INCBIN "pic/bmon/marowak.pic",0,1 ; 66, sprite dimensions
+INCBIN "pic/ymon/marowak.pic",0,1 ; 66, sprite dimensions
dw MarowakPicFront
dw MarowakPicBack
; attacks known at lvl 0
db BONE_CLUB
-db GROWL
-db LEER
-db FOCUS_ENERGY
+db TAIL_WHIP
+db 0
+db 0
db 0 ; growth rate
; learnset
tmlearn 1,5,6,8
diff --git a/data/baseStats/meowth.asm b/data/baseStats/meowth.asm
index dc146cf3..ce211d22 100644
--- a/data/baseStats/meowth.asm
+++ b/data/baseStats/meowth.asm
@@ -8,7 +8,7 @@ db NORMAL ; species type 1
db NORMAL ; species type 2
db 255 ; catch rate
db 69 ; base exp yield
-INCBIN "pic/bmon/meowth.pic",0,1 ; 55, sprite dimensions
+INCBIN "pic/ymon/meowth.pic",0,1 ; 55, sprite dimensions
dw MeowthPicFront
dw MeowthPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/metapod.asm b/data/baseStats/metapod.asm
index 9da351ad..b29a323d 100644
--- a/data/baseStats/metapod.asm
+++ b/data/baseStats/metapod.asm
@@ -8,7 +8,7 @@ db BUG ; species type 1
db BUG ; species type 2
db 120 ; catch rate
db 72 ; base exp yield
-INCBIN "pic/bmon/metapod.pic",0,1 ; 55, sprite dimensions
+INCBIN "pic/ymon/metapod.pic",0,1 ; 55, sprite dimensions
dw MetapodPicFront
dw MetapodPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/mew.asm b/data/baseStats/mew.asm
index 6919fd0e..7381bf6f 100644
--- a/data/baseStats/mew.asm
+++ b/data/baseStats/mew.asm
@@ -1,4 +1,3 @@
-MewBaseStats:
db DEX_MEW ; pokedex id
db 100 ; base hp
db 100 ; base attack
@@ -9,7 +8,7 @@ db PSYCHIC ; species type 1
db PSYCHIC ; species type 2
db 45 ; catch rate
db 64 ; base exp yield
-INCBIN "pic/bmon/mew.pic",0,1 ; 55, sprite dimensions
+INCBIN "pic/ymon/mew.pic",0,1 ; 55, sprite dimensions
dw MewPicFront
dw MewPicBack
; attacks known at lvl 0
@@ -25,5 +24,5 @@ db 3 ; growth rate
tmlearn 25,26,27,28,29,30,31,32
tmlearn 33,34,35,36,37,38,39,40
tmlearn 41,42,43,44,45,46,47,48
- tmlearn 49,50,51,52,53,54,55,56
-db %11111111 ; usually spacing
+ tmlearn 49,50,51,52,53,54,55
+db 0 ; usually spacing
diff --git a/data/baseStats/mewtwo.asm b/data/baseStats/mewtwo.asm
index dc597345..d6239384 100644
--- a/data/baseStats/mewtwo.asm
+++ b/data/baseStats/mewtwo.asm
@@ -8,7 +8,7 @@ db PSYCHIC ; species type 1
db PSYCHIC ; species type 2
db 3 ; catch rate
db 220 ; base exp yield
-INCBIN "pic/bmon/mewtwo.pic",0,1 ; 77, sprite dimensions
+INCBIN "pic/ymon/mewtwo.pic",0,1 ; 77, sprite dimensions
dw MewtwoPicFront
dw MewtwoPicBack
; attacks known at lvl 0
@@ -19,7 +19,7 @@ db PSYCHIC_M
db 5 ; growth rate
; learnset
tmlearn 1,5,6,8
- tmlearn 9,10,11,12,13,14,15,16
+ tmlearn 9,10,11,12,13,14,15
tmlearn 17,18,19,20,22,24
tmlearn 25,29,30,31,32
tmlearn 33,34,35,36,38,40
diff --git a/data/baseStats/moltres.asm b/data/baseStats/moltres.asm
index e9437405..5588e0df 100644
--- a/data/baseStats/moltres.asm
+++ b/data/baseStats/moltres.asm
@@ -8,7 +8,7 @@ db FIRE ; species type 1
db FLYING ; species type 2
db 3 ; catch rate
db 217 ; base exp yield
-INCBIN "pic/bmon/moltres.pic",0,1 ; 77, sprite dimensions
+INCBIN "pic/ymon/moltres.pic",0,1 ; 77, sprite dimensions
dw MoltresPicFront
dw MoltresPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/mrmime.asm b/data/baseStats/mrmime.asm
index 8640e340..87b110b7 100644
--- a/data/baseStats/mrmime.asm
+++ b/data/baseStats/mrmime.asm
@@ -8,7 +8,7 @@ db PSYCHIC ; species type 1
db PSYCHIC ; species type 2
db 45 ; catch rate
db 136 ; base exp yield
-INCBIN "pic/bmon/mr.mime.pic",0,1 ; 66, sprite dimensions
+INCBIN "pic/ymon/mr.mime.pic",0,1 ; 66, sprite dimensions
dw MrMimePicFront
dw MrMimePicBack
; attacks known at lvl 0
diff --git a/data/baseStats/muk.asm b/data/baseStats/muk.asm
index cb15563e..4e67df43 100644
--- a/data/baseStats/muk.asm
+++ b/data/baseStats/muk.asm
@@ -8,7 +8,7 @@ db POISON ; species type 1
db POISON ; species type 2
db 75 ; catch rate
db 157 ; base exp yield
-INCBIN "pic/bmon/muk.pic",0,1 ; 77, sprite dimensions
+INCBIN "pic/ymon/muk.pic",0,1 ; 77, sprite dimensions
dw MukPicFront
dw MukPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/nidoking.asm b/data/baseStats/nidoking.asm
index ebef0965..c9efa629 100644
--- a/data/baseStats/nidoking.asm
+++ b/data/baseStats/nidoking.asm
@@ -8,7 +8,7 @@ db POISON ; species type 1
db GROUND ; species type 2
db 45 ; catch rate
db 195 ; base exp yield
-INCBIN "pic/bmon/nidoking.pic",0,1 ; 77, sprite dimensions
+INCBIN "pic/ymon/nidoking.pic",0,1 ; 77, sprite dimensions
dw NidokingPicFront
dw NidokingPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/nidoqueen.asm b/data/baseStats/nidoqueen.asm
index 9ea29a31..f37cc0af 100644
--- a/data/baseStats/nidoqueen.asm
+++ b/data/baseStats/nidoqueen.asm
@@ -8,7 +8,7 @@ db POISON ; species type 1
db GROUND ; species type 2
db 45 ; catch rate
db 194 ; base exp yield
-INCBIN "pic/bmon/nidoqueen.pic",0,1 ; 77, sprite dimensions
+INCBIN "pic/ymon/nidoqueen.pic",0,1 ; 77, sprite dimensions
dw NidoqueenPicFront
dw NidoqueenPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/nidoranf.asm b/data/baseStats/nidoranf.asm
index 67832f18..9694a027 100644
--- a/data/baseStats/nidoranf.asm
+++ b/data/baseStats/nidoranf.asm
@@ -8,7 +8,7 @@ db POISON ; species type 1
db POISON ; species type 2
db 235 ; catch rate
db 59 ; base exp yield
-INCBIN "pic/bmon/nidoranf.pic",0,1 ; 55, sprite dimensions
+INCBIN "pic/ymon/nidoranf.pic",0,1 ; 55, sprite dimensions
dw NidoranFPicFront
dw NidoranFPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/nidoranm.asm b/data/baseStats/nidoranm.asm
index a7882766..0d04948e 100644
--- a/data/baseStats/nidoranm.asm
+++ b/data/baseStats/nidoranm.asm
@@ -8,7 +8,7 @@ db POISON ; species type 1
db POISON ; species type 2
db 235 ; catch rate
db 60 ; base exp yield
-INCBIN "pic/bmon/nidoranm.pic",0,1 ; 55, sprite dimensions
+INCBIN "pic/ymon/nidoranm.pic",0,1 ; 55, sprite dimensions
dw NidoranMPicFront
dw NidoranMPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/nidorina.asm b/data/baseStats/nidorina.asm
index 0ddecf70..e8375d97 100644
--- a/data/baseStats/nidorina.asm
+++ b/data/baseStats/nidorina.asm
@@ -8,7 +8,7 @@ db POISON ; species type 1
db POISON ; species type 2
db 120 ; catch rate
db 117 ; base exp yield
-INCBIN "pic/bmon/nidorina.pic",0,1 ; 66, sprite dimensions
+INCBIN "pic/ymon/nidorina.pic",0,1 ; 66, sprite dimensions
dw NidorinaPicFront
dw NidorinaPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/nidorino.asm b/data/baseStats/nidorino.asm
index fc435fc4..ca28b121 100644
--- a/data/baseStats/nidorino.asm
+++ b/data/baseStats/nidorino.asm
@@ -8,7 +8,7 @@ db POISON ; species type 1
db POISON ; species type 2
db 120 ; catch rate
db 118 ; base exp yield
-INCBIN "pic/bmon/nidorino.pic",0,1 ; 66, sprite dimensions
+INCBIN "pic/ymon/nidorino.pic",0,1 ; 66, sprite dimensions
dw NidorinoPicFront
dw NidorinoPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/ninetales.asm b/data/baseStats/ninetales.asm
index e98028dc..212f6322 100644
--- a/data/baseStats/ninetales.asm
+++ b/data/baseStats/ninetales.asm
@@ -8,7 +8,7 @@ db FIRE ; species type 1
db FIRE ; species type 2
db 75 ; catch rate
db 178 ; base exp yield
-INCBIN "pic/bmon/ninetales.pic",0,1 ; 77, sprite dimensions
+INCBIN "pic/ymon/ninetales.pic",0,1 ; 77, sprite dimensions
dw NinetalesPicFront
dw NinetalesPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/oddish.asm b/data/baseStats/oddish.asm
index c91c5138..aabc873b 100644
--- a/data/baseStats/oddish.asm
+++ b/data/baseStats/oddish.asm
@@ -8,7 +8,7 @@ db GRASS ; species type 1
db POISON ; species type 2
db 255 ; catch rate
db 78 ; base exp yield
-INCBIN "pic/bmon/oddish.pic",0,1 ; 55, sprite dimensions
+INCBIN "pic/ymon/oddish.pic",0,1 ; 55, sprite dimensions
dw OddishPicFront
dw OddishPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/omanyte.asm b/data/baseStats/omanyte.asm
index 3c461876..89a6b824 100644
--- a/data/baseStats/omanyte.asm
+++ b/data/baseStats/omanyte.asm
@@ -8,7 +8,7 @@ db ROCK ; species type 1
db WATER ; species type 2
db 45 ; catch rate
db 120 ; base exp yield
-INCBIN "pic/bmon/omanyte.pic",0,1 ; 55, sprite dimensions
+INCBIN "pic/ymon/omanyte.pic",0,1 ; 55, sprite dimensions
dw OmanytePicFront
dw OmanytePicBack
; attacks known at lvl 0
diff --git a/data/baseStats/omastar.asm b/data/baseStats/omastar.asm
index 09a2ae77..2066c8c2 100644
--- a/data/baseStats/omastar.asm
+++ b/data/baseStats/omastar.asm
@@ -8,7 +8,7 @@ db ROCK ; species type 1
db WATER ; species type 2
db 45 ; catch rate
db 199 ; base exp yield
-INCBIN "pic/bmon/omastar.pic",0,1 ; 66, sprite dimensions
+INCBIN "pic/ymon/omastar.pic",0,1 ; 66, sprite dimensions
dw OmastarPicFront
dw OmastarPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/onix.asm b/data/baseStats/onix.asm
index 6f3be4df..1e2f6ed5 100644
--- a/data/baseStats/onix.asm
+++ b/data/baseStats/onix.asm
@@ -8,7 +8,7 @@ db ROCK ; species type 1
db GROUND ; species type 2
db 45 ; catch rate
db 108 ; base exp yield
-INCBIN "pic/bmon/onix.pic",0,1 ; 77, sprite dimensions
+INCBIN "pic/ymon/onix.pic",0,1 ; 77, sprite dimensions
dw OnixPicFront
dw OnixPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/paras.asm b/data/baseStats/paras.asm
index 2c918e68..273ec7a3 100644
--- a/data/baseStats/paras.asm
+++ b/data/baseStats/paras.asm
@@ -8,7 +8,7 @@ db BUG ; species type 1
db GRASS ; species type 2
db 190 ; catch rate
db 70 ; base exp yield
-INCBIN "pic/bmon/paras.pic",0,1 ; 55, sprite dimensions
+INCBIN "pic/ymon/paras.pic",0,1 ; 55, sprite dimensions
dw ParasPicFront
dw ParasPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/parasect.asm b/data/baseStats/parasect.asm
index dfa0c73e..ed5c7015 100644
--- a/data/baseStats/parasect.asm
+++ b/data/baseStats/parasect.asm
@@ -8,7 +8,7 @@ db BUG ; species type 1
db GRASS ; species type 2
db 75 ; catch rate
db 128 ; base exp yield
-INCBIN "pic/bmon/parasect.pic",0,1 ; 77, sprite dimensions
+INCBIN "pic/ymon/parasect.pic",0,1 ; 77, sprite dimensions
dw ParasectPicFront
dw ParasectPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/persian.asm b/data/baseStats/persian.asm
index 2f5ef125..5ace4f35 100644
--- a/data/baseStats/persian.asm
+++ b/data/baseStats/persian.asm
@@ -8,7 +8,7 @@ db NORMAL ; species type 1
db NORMAL ; species type 2
db 90 ; catch rate
db 148 ; base exp yield
-INCBIN "pic/bmon/persian.pic",0,1 ; 77, sprite dimensions
+INCBIN "pic/ymon/persian.pic",0,1 ; 77, sprite dimensions
dw PersianPicFront
dw PersianPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/pidgeot.asm b/data/baseStats/pidgeot.asm
index 05350d07..e0240fb1 100644
--- a/data/baseStats/pidgeot.asm
+++ b/data/baseStats/pidgeot.asm
@@ -8,7 +8,7 @@ db NORMAL ; species type 1
db FLYING ; species type 2
db 45 ; catch rate
db 172 ; base exp yield
-INCBIN "pic/bmon/pidgeot.pic",0,1 ; 77, sprite dimensions
+INCBIN "pic/ymon/pidgeot.pic",0,1 ; 77, sprite dimensions
dw PidgeotPicFront
dw PidgeotPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/pidgeotto.asm b/data/baseStats/pidgeotto.asm
index 74440fcc..2930b5ae 100644
--- a/data/baseStats/pidgeotto.asm
+++ b/data/baseStats/pidgeotto.asm
@@ -8,7 +8,7 @@ db NORMAL ; species type 1
db FLYING ; species type 2
db 120 ; catch rate
db 113 ; base exp yield
-INCBIN "pic/bmon/pidgeotto.pic",0,1 ; 66, sprite dimensions
+INCBIN "pic/ymon/pidgeotto.pic",0,1 ; 66, sprite dimensions
dw PidgeottoPicFront
dw PidgeottoPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/pidgey.asm b/data/baseStats/pidgey.asm
index ec032d6b..c110a32e 100644
--- a/data/baseStats/pidgey.asm
+++ b/data/baseStats/pidgey.asm
@@ -8,7 +8,7 @@ db NORMAL ; species type 1
db FLYING ; species type 2
db 255 ; catch rate
db 55 ; base exp yield
-INCBIN "pic/bmon/pidgey.pic",0,1 ; 55, sprite dimensions
+INCBIN "pic/ymon/pidgey.pic",0,1 ; 55, sprite dimensions
dw PidgeyPicFront
dw PidgeyPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/pikachu.asm b/data/baseStats/pikachu.asm
index 09971b79..5e81a85f 100644
--- a/data/baseStats/pikachu.asm
+++ b/data/baseStats/pikachu.asm
@@ -8,7 +8,7 @@ db ELECTRIC ; species type 1
db ELECTRIC ; species type 2
db 190 ; catch rate
db 82 ; base exp yield
-INCBIN "pic/bmon/pikachu.pic",0,1 ; 55, sprite dimensions
+INCBIN "pic/ymon/pikachu.pic",0,1 ; 55, sprite dimensions
dw PikachuPicFront
dw PikachuPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/pinsir.asm b/data/baseStats/pinsir.asm
index 08c0e95a..b79f01a3 100644
--- a/data/baseStats/pinsir.asm
+++ b/data/baseStats/pinsir.asm
@@ -8,7 +8,7 @@ db BUG ; species type 1
db BUG ; species type 2
db 45 ; catch rate
db 200 ; base exp yield
-INCBIN "pic/bmon/pinsir.pic",0,1 ; 77, sprite dimensions
+INCBIN "pic/ymon/pinsir.pic",0,1 ; 77, sprite dimensions
dw PinsirPicFront
dw PinsirPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/poliwag.asm b/data/baseStats/poliwag.asm
index 8014811e..9c89fc49 100644
--- a/data/baseStats/poliwag.asm
+++ b/data/baseStats/poliwag.asm
@@ -8,7 +8,7 @@ db WATER ; species type 1
db WATER ; species type 2
db 255 ; catch rate
db 77 ; base exp yield
-INCBIN "pic/bmon/poliwag.pic",0,1 ; 55, sprite dimensions
+INCBIN "pic/ymon/poliwag.pic",0,1 ; 55, sprite dimensions
dw PoliwagPicFront
dw PoliwagPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/poliwhirl.asm b/data/baseStats/poliwhirl.asm
index 6209da68..c836e194 100644
--- a/data/baseStats/poliwhirl.asm
+++ b/data/baseStats/poliwhirl.asm
@@ -8,7 +8,7 @@ db WATER ; species type 1
db WATER ; species type 2
db 120 ; catch rate
db 131 ; base exp yield
-INCBIN "pic/bmon/poliwhirl.pic",0,1 ; 66, sprite dimensions
+INCBIN "pic/ymon/poliwhirl.pic",0,1 ; 66, sprite dimensions
dw PoliwhirlPicFront
dw PoliwhirlPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/poliwrath.asm b/data/baseStats/poliwrath.asm
index 9489a6a3..5a1acd9f 100644
--- a/data/baseStats/poliwrath.asm
+++ b/data/baseStats/poliwrath.asm
@@ -8,7 +8,7 @@ db WATER ; species type 1
db FIGHTING ; species type 2
db 45 ; catch rate
db 185 ; base exp yield
-INCBIN "pic/bmon/poliwrath.pic",0,1 ; 77, sprite dimensions
+INCBIN "pic/ymon/poliwrath.pic",0,1 ; 77, sprite dimensions
dw PoliwrathPicFront
dw PoliwrathPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/ponyta.asm b/data/baseStats/ponyta.asm
index a6ff9e4b..3c779075 100644
--- a/data/baseStats/ponyta.asm
+++ b/data/baseStats/ponyta.asm
@@ -8,7 +8,7 @@ db FIRE ; species type 1
db FIRE ; species type 2
db 190 ; catch rate
db 152 ; base exp yield
-INCBIN "pic/bmon/ponyta.pic",0,1 ; 66, sprite dimensions
+INCBIN "pic/ymon/ponyta.pic",0,1 ; 66, sprite dimensions
dw PonytaPicFront
dw PonytaPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/porygon.asm b/data/baseStats/porygon.asm
index a049fa7f..502bbc4f 100644
--- a/data/baseStats/porygon.asm
+++ b/data/baseStats/porygon.asm
@@ -8,7 +8,7 @@ db NORMAL ; species type 1
db NORMAL ; species type 2
db 45 ; catch rate
db 130 ; base exp yield
-INCBIN "pic/bmon/porygon.pic",0,1 ; 66, sprite dimensions
+INCBIN "pic/ymon/porygon.pic",0,1 ; 66, sprite dimensions
dw PorygonPicFront
dw PorygonPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/primeape.asm b/data/baseStats/primeape.asm
index 659edefd..3eeac4f3 100644
--- a/data/baseStats/primeape.asm
+++ b/data/baseStats/primeape.asm
@@ -8,14 +8,14 @@ db FIGHTING ; species type 1
db FIGHTING ; species type 2
db 75 ; catch rate
db 149 ; base exp yield
-INCBIN "pic/bmon/primeape.pic",0,1 ; 77, sprite dimensions
+INCBIN "pic/ymon/primeape.pic",0,1 ; 77, sprite dimensions
dw PrimeapePicFront
dw PrimeapePicBack
; attacks known at lvl 0
db SCRATCH
db LEER
+db LOW_KICK
db KARATE_CHOP
-db FURY_SWIPES
db 0 ; growth rate
; learnset
tmlearn 1,5,6,8
diff --git a/data/baseStats/psyduck.asm b/data/baseStats/psyduck.asm
index db3ac79f..e3ab72bb 100644
--- a/data/baseStats/psyduck.asm
+++ b/data/baseStats/psyduck.asm
@@ -8,7 +8,7 @@ db WATER ; species type 1
db WATER ; species type 2
db 190 ; catch rate
db 80 ; base exp yield
-INCBIN "pic/bmon/psyduck.pic",0,1 ; 55, sprite dimensions
+INCBIN "pic/ymon/psyduck.pic",0,1 ; 55, sprite dimensions
dw PsyduckPicFront
dw PsyduckPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/raichu.asm b/data/baseStats/raichu.asm
index c830483c..c63231b3 100644
--- a/data/baseStats/raichu.asm
+++ b/data/baseStats/raichu.asm
@@ -8,7 +8,7 @@ db ELECTRIC ; species type 1
db ELECTRIC ; species type 2
db 75 ; catch rate
db 122 ; base exp yield
-INCBIN "pic/bmon/raichu.pic",0,1 ; 77, sprite dimensions
+INCBIN "pic/ymon/raichu.pic",0,1 ; 77, sprite dimensions
dw RaichuPicFront
dw RaichuPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/rapidash.asm b/data/baseStats/rapidash.asm
index c452159e..18781739 100644
--- a/data/baseStats/rapidash.asm
+++ b/data/baseStats/rapidash.asm
@@ -8,7 +8,7 @@ db FIRE ; species type 1
db FIRE ; species type 2
db 60 ; catch rate
db 192 ; base exp yield
-INCBIN "pic/bmon/rapidash.pic",0,1 ; 77, sprite dimensions
+INCBIN "pic/ymon/rapidash.pic",0,1 ; 77, sprite dimensions
dw RapidashPicFront
dw RapidashPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/raticate.asm b/data/baseStats/raticate.asm
index ff8373d5..85aa044b 100644
--- a/data/baseStats/raticate.asm
+++ b/data/baseStats/raticate.asm
@@ -8,7 +8,7 @@ db NORMAL ; species type 1
db NORMAL ; species type 2
db 90 ; catch rate
db 116 ; base exp yield
-INCBIN "pic/bmon/raticate.pic",0,1 ; 66, sprite dimensions
+INCBIN "pic/ymon/raticate.pic",0,1 ; 66, sprite dimensions
dw RaticatePicFront
dw RaticatePicBack
; attacks known at lvl 0
diff --git a/data/baseStats/rattata.asm b/data/baseStats/rattata.asm
index 7edfb626..165dce14 100644
--- a/data/baseStats/rattata.asm
+++ b/data/baseStats/rattata.asm
@@ -8,7 +8,7 @@ db NORMAL ; species type 1
db NORMAL ; species type 2
db 255 ; catch rate
db 57 ; base exp yield
-INCBIN "pic/bmon/rattata.pic",0,1 ; 55, sprite dimensions
+INCBIN "pic/ymon/rattata.pic",0,1 ; 55, sprite dimensions
dw RattataPicFront
dw RattataPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/rhydon.asm b/data/baseStats/rhydon.asm
index d7066906..b183c282 100644
--- a/data/baseStats/rhydon.asm
+++ b/data/baseStats/rhydon.asm
@@ -8,7 +8,7 @@ db GROUND ; species type 1
db ROCK ; species type 2
db 60 ; catch rate
db 204 ; base exp yield
-INCBIN "pic/bmon/rhydon.pic",0,1 ; 77, sprite dimensions
+INCBIN "pic/ymon/rhydon.pic",0,1 ; 77, sprite dimensions
dw RhydonPicFront
dw RhydonPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/rhyhorn.asm b/data/baseStats/rhyhorn.asm
index a6491bd5..41a1e360 100644
--- a/data/baseStats/rhyhorn.asm
+++ b/data/baseStats/rhyhorn.asm
@@ -8,7 +8,7 @@ db GROUND ; species type 1
db ROCK ; species type 2
db 120 ; catch rate
db 135 ; base exp yield
-INCBIN "pic/bmon/rhyhorn.pic",0,1 ; 77, sprite dimensions
+INCBIN "pic/ymon/rhyhorn.pic",0,1 ; 77, sprite dimensions
dw RhyhornPicFront
dw RhyhornPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/sandshrew.asm b/data/baseStats/sandshrew.asm
index a9875a8e..b4c6abb8 100644
--- a/data/baseStats/sandshrew.asm
+++ b/data/baseStats/sandshrew.asm
@@ -8,7 +8,7 @@ db GROUND ; species type 1
db GROUND ; species type 2
db 255 ; catch rate
db 93 ; base exp yield
-INCBIN "pic/bmon/sandshrew.pic",0,1 ; 55, sprite dimensions
+INCBIN "pic/ymon/sandshrew.pic",0,1 ; 55, sprite dimensions
dw SandshrewPicFront
dw SandshrewPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/sandslash.asm b/data/baseStats/sandslash.asm
index 30477eb4..e47467ef 100644
--- a/data/baseStats/sandslash.asm
+++ b/data/baseStats/sandslash.asm
@@ -8,7 +8,7 @@ db GROUND ; species type 1
db GROUND ; species type 2
db 90 ; catch rate
db 163 ; base exp yield
-INCBIN "pic/bmon/sandslash.pic",0,1 ; 66, sprite dimensions
+INCBIN "pic/ymon/sandslash.pic",0,1 ; 66, sprite dimensions
dw SandslashPicFront
dw SandslashPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/scyther.asm b/data/baseStats/scyther.asm
index 13de0d2b..ea3f3cba 100644
--- a/data/baseStats/scyther.asm
+++ b/data/baseStats/scyther.asm
@@ -8,7 +8,7 @@ db BUG ; species type 1
db FLYING ; species type 2
db 45 ; catch rate
db 187 ; base exp yield
-INCBIN "pic/bmon/scyther.pic",0,1 ; 77, sprite dimensions
+INCBIN "pic/ymon/scyther.pic",0,1 ; 77, sprite dimensions
dw ScytherPicFront
dw ScytherPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/seadra.asm b/data/baseStats/seadra.asm
index 9f28001b..4f5614af 100644
--- a/data/baseStats/seadra.asm
+++ b/data/baseStats/seadra.asm
@@ -8,7 +8,7 @@ db WATER ; species type 1
db WATER ; species type 2
db 75 ; catch rate
db 155 ; base exp yield
-INCBIN "pic/bmon/seadra.pic",0,1 ; 66, sprite dimensions
+INCBIN "pic/ymon/seadra.pic",0,1 ; 66, sprite dimensions
dw SeadraPicFront
dw SeadraPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/seaking.asm b/data/baseStats/seaking.asm
index d4fbe8ea..de983475 100644
--- a/data/baseStats/seaking.asm
+++ b/data/baseStats/seaking.asm
@@ -8,7 +8,7 @@ db WATER ; species type 1
db WATER ; species type 2
db 60 ; catch rate
db 170 ; base exp yield
-INCBIN "pic/bmon/seaking.pic",0,1 ; 77, sprite dimensions
+INCBIN "pic/ymon/seaking.pic",0,1 ; 77, sprite dimensions
dw SeakingPicFront
dw SeakingPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/seel.asm b/data/baseStats/seel.asm
index ef9c2898..4a82ad72 100644
--- a/data/baseStats/seel.asm
+++ b/data/baseStats/seel.asm
@@ -8,7 +8,7 @@ db WATER ; species type 1
db WATER ; species type 2
db 190 ; catch rate
db 100 ; base exp yield
-INCBIN "pic/bmon/seel.pic",0,1 ; 66, sprite dimensions
+INCBIN "pic/ymon/seel.pic",0,1 ; 66, sprite dimensions
dw SeelPicFront
dw SeelPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/shellder.asm b/data/baseStats/shellder.asm
index 7c2cdf9d..1a4644cb 100644
--- a/data/baseStats/shellder.asm
+++ b/data/baseStats/shellder.asm
@@ -8,7 +8,7 @@ db WATER ; species type 1
db WATER ; species type 2
db 190 ; catch rate
db 97 ; base exp yield
-INCBIN "pic/bmon/shellder.pic",0,1 ; 55, sprite dimensions
+INCBIN "pic/ymon/shellder.pic",0,1 ; 55, sprite dimensions
dw ShellderPicFront
dw ShellderPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/slowbro.asm b/data/baseStats/slowbro.asm
index ffeda79e..f471a646 100644
--- a/data/baseStats/slowbro.asm
+++ b/data/baseStats/slowbro.asm
@@ -8,7 +8,7 @@ db WATER ; species type 1
db PSYCHIC ; species type 2
db 75 ; catch rate
db 164 ; base exp yield
-INCBIN "pic/bmon/slowbro.pic",0,1 ; 77, sprite dimensions
+INCBIN "pic/ymon/slowbro.pic",0,1 ; 77, sprite dimensions
dw SlowbroPicFront
dw SlowbroPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/slowpoke.asm b/data/baseStats/slowpoke.asm
index ea238a6e..f7a1a510 100644
--- a/data/baseStats/slowpoke.asm
+++ b/data/baseStats/slowpoke.asm
@@ -8,7 +8,7 @@ db WATER ; species type 1
db PSYCHIC ; species type 2
db 190 ; catch rate
db 99 ; base exp yield
-INCBIN "pic/bmon/slowpoke.pic",0,1 ; 55, sprite dimensions
+INCBIN "pic/ymon/slowpoke.pic",0,1 ; 55, sprite dimensions
dw SlowpokePicFront
dw SlowpokePicBack
; attacks known at lvl 0
diff --git a/data/baseStats/snorlax.asm b/data/baseStats/snorlax.asm
index 2d1fd6e3..62144d31 100644
--- a/data/baseStats/snorlax.asm
+++ b/data/baseStats/snorlax.asm
@@ -8,7 +8,7 @@ db NORMAL ; species type 1
db NORMAL ; species type 2
db 25 ; catch rate
db 154 ; base exp yield
-INCBIN "pic/bmon/snorlax.pic",0,1 ; 77, sprite dimensions
+INCBIN "pic/ymon/snorlax.pic",0,1 ; 77, sprite dimensions
dw SnorlaxPicFront
dw SnorlaxPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/spearow.asm b/data/baseStats/spearow.asm
index eb8ab1ec..b7d35b3a 100644
--- a/data/baseStats/spearow.asm
+++ b/data/baseStats/spearow.asm
@@ -8,7 +8,7 @@ db NORMAL ; species type 1
db FLYING ; species type 2
db 255 ; catch rate
db 58 ; base exp yield
-INCBIN "pic/bmon/spearow.pic",0,1 ; 55, sprite dimensions
+INCBIN "pic/ymon/spearow.pic",0,1 ; 55, sprite dimensions
dw SpearowPicFront
dw SpearowPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/squirtle.asm b/data/baseStats/squirtle.asm
index f8dcd0a1..1d302a00 100644
--- a/data/baseStats/squirtle.asm
+++ b/data/baseStats/squirtle.asm
@@ -8,7 +8,7 @@ db WATER ; species type 1
db WATER ; species type 2
db 45 ; catch rate
db 66 ; base exp yield
-INCBIN "pic/bmon/squirtle.pic",0,1 ; 55, sprite dimensions
+INCBIN "pic/ymon/squirtle.pic",0,1 ; 55, sprite dimensions
dw SquirtlePicFront
dw SquirtlePicBack
; attacks known at lvl 0
diff --git a/data/baseStats/starmie.asm b/data/baseStats/starmie.asm
index 686dfa57..8ef77af8 100644
--- a/data/baseStats/starmie.asm
+++ b/data/baseStats/starmie.asm
@@ -8,7 +8,7 @@ db WATER ; species type 1
db PSYCHIC ; species type 2
db 60 ; catch rate
db 207 ; base exp yield
-INCBIN "pic/bmon/starmie.pic",0,1 ; 66, sprite dimensions
+INCBIN "pic/ymon/starmie.pic",0,1 ; 66, sprite dimensions
dw StarmiePicFront
dw StarmiePicBack
; attacks known at lvl 0
diff --git a/data/baseStats/staryu.asm b/data/baseStats/staryu.asm
index 35f51a6a..bc774f42 100644
--- a/data/baseStats/staryu.asm
+++ b/data/baseStats/staryu.asm
@@ -8,7 +8,7 @@ db WATER ; species type 1
db WATER ; species type 2
db 225 ; catch rate
db 106 ; base exp yield
-INCBIN "pic/bmon/staryu.pic",0,1 ; 66, sprite dimensions
+INCBIN "pic/ymon/staryu.pic",0,1 ; 66, sprite dimensions
dw StaryuPicFront
dw StaryuPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/tangela.asm b/data/baseStats/tangela.asm
index b50a57bc..8b76bde5 100644
--- a/data/baseStats/tangela.asm
+++ b/data/baseStats/tangela.asm
@@ -8,12 +8,12 @@ db GRASS ; species type 1
db GRASS ; species type 2
db 45 ; catch rate
db 166 ; base exp yield
-INCBIN "pic/bmon/tangela.pic",0,1 ; 66, sprite dimensions
+INCBIN "pic/ymon/tangela.pic",0,1 ; 66, sprite dimensions
dw TangelaPicFront
dw TangelaPicBack
; attacks known at lvl 0
db CONSTRICT
-db BIND
+db 0
db 0
db 0
db 0 ; growth rate
diff --git a/data/baseStats/tauros.asm b/data/baseStats/tauros.asm
index 87f28ec6..ac55ed65 100644
--- a/data/baseStats/tauros.asm
+++ b/data/baseStats/tauros.asm
@@ -8,7 +8,7 @@ db NORMAL ; species type 1
db NORMAL ; species type 2
db 45 ; catch rate
db 211 ; base exp yield
-INCBIN "pic/bmon/tauros.pic",0,1 ; 77, sprite dimensions
+INCBIN "pic/ymon/tauros.pic",0,1 ; 77, sprite dimensions
dw TaurosPicFront
dw TaurosPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/tentacool.asm b/data/baseStats/tentacool.asm
index 7237f083..123d904c 100644
--- a/data/baseStats/tentacool.asm
+++ b/data/baseStats/tentacool.asm
@@ -8,7 +8,7 @@ db WATER ; species type 1
db POISON ; species type 2
db 190 ; catch rate
db 105 ; base exp yield
-INCBIN "pic/bmon/tentacool.pic",0,1 ; 55, sprite dimensions
+INCBIN "pic/ymon/tentacool.pic",0,1 ; 55, sprite dimensions
dw TentacoolPicFront
dw TentacoolPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/tentacruel.asm b/data/baseStats/tentacruel.asm
index d3d93919..9c65fe15 100644
--- a/data/baseStats/tentacruel.asm
+++ b/data/baseStats/tentacruel.asm
@@ -8,7 +8,7 @@ db WATER ; species type 1
db POISON ; species type 2
db 60 ; catch rate
db 205 ; base exp yield
-INCBIN "pic/bmon/tentacruel.pic",0,1 ; 66, sprite dimensions
+INCBIN "pic/ymon/tentacruel.pic",0,1 ; 66, sprite dimensions
dw TentacruelPicFront
dw TentacruelPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/vaporeon.asm b/data/baseStats/vaporeon.asm
index e22b3185..3d5024b5 100644
--- a/data/baseStats/vaporeon.asm
+++ b/data/baseStats/vaporeon.asm
@@ -8,12 +8,12 @@ db WATER ; species type 1
db WATER ; species type 2
db 45 ; catch rate
db 196 ; base exp yield
-INCBIN "pic/bmon/vaporeon.pic",0,1 ; 66, sprite dimensions
+INCBIN "pic/ymon/vaporeon.pic",0,1 ; 66, sprite dimensions
dw VaporeonPicFront
dw VaporeonPicBack
; attacks known at lvl 0
db TACKLE
-db SAND_ATTACK
+db TAIL_WHIP
db QUICK_ATTACK
db WATER_GUN
db 0 ; growth rate
diff --git a/data/baseStats/venomoth.asm b/data/baseStats/venomoth.asm
index 7a5bd981..6709e42a 100644
--- a/data/baseStats/venomoth.asm
+++ b/data/baseStats/venomoth.asm
@@ -8,14 +8,14 @@ db BUG ; species type 1
db POISON ; species type 2
db 75 ; catch rate
db 138 ; base exp yield
-INCBIN "pic/bmon/venomoth.pic",0,1 ; 77, sprite dimensions
+INCBIN "pic/ymon/venomoth.pic",0,1 ; 77, sprite dimensions
dw VenomothPicFront
dw VenomothPicBack
; attacks known at lvl 0
db TACKLE
db DISABLE
-db POISONPOWDER
-db LEECH_LIFE
+db SUPERSONIC
+db CONFUSION
db 0 ; growth rate
; learnset
tmlearn 2,4,6
@@ -24,5 +24,5 @@ db 0 ; growth rate
tmlearn 29,30,31,32
tmlearn 33,34,39
tmlearn 44,46
- tmlearn 50
+ tmlearn 50,55
db 0 ; padding
diff --git a/data/baseStats/venonat.asm b/data/baseStats/venonat.asm
index aeadc6cd..ef3db9a1 100644
--- a/data/baseStats/venonat.asm
+++ b/data/baseStats/venonat.asm
@@ -8,7 +8,7 @@ db BUG ; species type 1
db POISON ; species type 2
db 190 ; catch rate
db 75 ; base exp yield
-INCBIN "pic/bmon/venonat.pic",0,1 ; 55, sprite dimensions
+INCBIN "pic/ymon/venonat.pic",0,1 ; 55, sprite dimensions
dw VenonatPicFront
dw VenonatPicBack
; attacks known at lvl 0
@@ -24,5 +24,5 @@ db 0 ; growth rate
tmlearn 29,31,32
tmlearn 33,34
tmlearn 44,46
- tmlearn 50
+ tmlearn 50,55
db 0 ; padding
diff --git a/data/baseStats/venusaur.asm b/data/baseStats/venusaur.asm
index 0a457321..d3725735 100644
--- a/data/baseStats/venusaur.asm
+++ b/data/baseStats/venusaur.asm
@@ -8,7 +8,7 @@ db GRASS ; species type 1
db POISON ; species type 2
db 45 ; catch rate
db 208 ; base exp yield
-INCBIN "pic/bmon/venusaur.pic",0,1 ; 77, sprite dimensions
+INCBIN "pic/ymon/venusaur.pic",0,1 ; 77, sprite dimensions
dw VenusaurPicFront
dw VenusaurPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/victreebel.asm b/data/baseStats/victreebel.asm
index 7a82c86e..56bfd25a 100644
--- a/data/baseStats/victreebel.asm
+++ b/data/baseStats/victreebel.asm
@@ -8,7 +8,7 @@ db GRASS ; species type 1
db POISON ; species type 2
db 45 ; catch rate
db 191 ; base exp yield
-INCBIN "pic/bmon/victreebel.pic",0,1 ; 77, sprite dimensions
+INCBIN "pic/ymon/victreebel.pic",0,1 ; 77, sprite dimensions
dw VictreebelPicFront
dw VictreebelPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/vileplume.asm b/data/baseStats/vileplume.asm
index 17bb9739..ed463650 100644
--- a/data/baseStats/vileplume.asm
+++ b/data/baseStats/vileplume.asm
@@ -8,7 +8,7 @@ db GRASS ; species type 1
db POISON ; species type 2
db 45 ; catch rate
db 184 ; base exp yield
-INCBIN "pic/bmon/vileplume.pic",0,1 ; 77, sprite dimensions
+INCBIN "pic/ymon/vileplume.pic",0,1 ; 77, sprite dimensions
dw VileplumePicFront
dw VileplumePicBack
; attacks known at lvl 0
diff --git a/data/baseStats/voltorb.asm b/data/baseStats/voltorb.asm
index 92d2ccb3..ffd12992 100644
--- a/data/baseStats/voltorb.asm
+++ b/data/baseStats/voltorb.asm
@@ -8,7 +8,7 @@ db ELECTRIC ; species type 1
db ELECTRIC ; species type 2
db 190 ; catch rate
db 103 ; base exp yield
-INCBIN "pic/bmon/voltorb.pic",0,1 ; 55, sprite dimensions
+INCBIN "pic/ymon/voltorb.pic",0,1 ; 55, sprite dimensions
dw VoltorbPicFront
dw VoltorbPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/vulpix.asm b/data/baseStats/vulpix.asm
index 9577ae30..b67b9bbd 100644
--- a/data/baseStats/vulpix.asm
+++ b/data/baseStats/vulpix.asm
@@ -8,7 +8,7 @@ db FIRE ; species type 1
db FIRE ; species type 2
db 190 ; catch rate
db 63 ; base exp yield
-INCBIN "pic/bmon/vulpix.pic",0,1 ; 66, sprite dimensions
+INCBIN "pic/ymon/vulpix.pic",0,1 ; 66, sprite dimensions
dw VulpixPicFront
dw VulpixPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/wartortle.asm b/data/baseStats/wartortle.asm
index bc86bd6f..daf85dc6 100644
--- a/data/baseStats/wartortle.asm
+++ b/data/baseStats/wartortle.asm
@@ -8,7 +8,7 @@ db WATER ; species type 1
db WATER ; species type 2
db 45 ; catch rate
db 143 ; base exp yield
-INCBIN "pic/bmon/wartortle.pic",0,1 ; 66, sprite dimensions
+INCBIN "pic/ymon/wartortle.pic",0,1 ; 66, sprite dimensions
dw WartortlePicFront
dw WartortlePicBack
; attacks known at lvl 0
diff --git a/data/baseStats/weedle.asm b/data/baseStats/weedle.asm
index 8370dc41..44ca5c2c 100644
--- a/data/baseStats/weedle.asm
+++ b/data/baseStats/weedle.asm
@@ -8,7 +8,7 @@ db BUG ; species type 1
db POISON ; species type 2
db 255 ; catch rate
db 52 ; base exp yield
-INCBIN "pic/bmon/weedle.pic",0,1 ; 55, sprite dimensions
+INCBIN "pic/ymon/weedle.pic",0,1 ; 55, sprite dimensions
dw WeedlePicFront
dw WeedlePicBack
; attacks known at lvl 0
diff --git a/data/baseStats/weepinbell.asm b/data/baseStats/weepinbell.asm
index 735a453f..0ac287f8 100644
--- a/data/baseStats/weepinbell.asm
+++ b/data/baseStats/weepinbell.asm
@@ -8,7 +8,7 @@ db GRASS ; species type 1
db POISON ; species type 2
db 120 ; catch rate
db 151 ; base exp yield
-INCBIN "pic/bmon/weepinbell.pic",0,1 ; 66, sprite dimensions
+INCBIN "pic/ymon/weepinbell.pic",0,1 ; 66, sprite dimensions
dw WeepinbellPicFront
dw WeepinbellPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/weezing.asm b/data/baseStats/weezing.asm
index 0dd09dfe..089ef495 100644
--- a/data/baseStats/weezing.asm
+++ b/data/baseStats/weezing.asm
@@ -8,7 +8,7 @@ db POISON ; species type 1
db POISON ; species type 2
db 60 ; catch rate
db 173 ; base exp yield
-INCBIN "pic/bmon/weezing.pic",0,1 ; 77, sprite dimensions
+INCBIN "pic/ymon/weezing.pic",0,1 ; 77, sprite dimensions
dw WeezingPicFront
dw WeezingPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/wigglytuff.asm b/data/baseStats/wigglytuff.asm
index d5fd08e2..815b1244 100644
--- a/data/baseStats/wigglytuff.asm
+++ b/data/baseStats/wigglytuff.asm
@@ -8,7 +8,7 @@ db NORMAL ; species type 1
db NORMAL ; species type 2
db 50 ; catch rate
db 109 ; base exp yield
-INCBIN "pic/bmon/wigglytuff.pic",0,1 ; 66, sprite dimensions
+INCBIN "pic/ymon/wigglytuff.pic",0,1 ; 66, sprite dimensions
dw WigglytuffPicFront
dw WigglytuffPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/zapdos.asm b/data/baseStats/zapdos.asm
index 487052ba..b7befb99 100644
--- a/data/baseStats/zapdos.asm
+++ b/data/baseStats/zapdos.asm
@@ -8,7 +8,7 @@ db ELECTRIC ; species type 1
db FLYING ; species type 2
db 3 ; catch rate
db 216 ; base exp yield
-INCBIN "pic/bmon/zapdos.pic",0,1 ; 77, sprite dimensions
+INCBIN "pic/ymon/zapdos.pic",0,1 ; 77, sprite dimensions
dw ZapdosPicFront
dw ZapdosPicBack
; attacks known at lvl 0
diff --git a/data/baseStats/zubat.asm b/data/baseStats/zubat.asm
index 1caa4259..7ddad05c 100644
--- a/data/baseStats/zubat.asm
+++ b/data/baseStats/zubat.asm
@@ -8,7 +8,7 @@ db POISON ; species type 1
db FLYING ; species type 2
db 255 ; catch rate
db 54 ; base exp yield
-INCBIN "pic/bmon/zubat.pic",0,1 ; 55, sprite dimensions
+INCBIN "pic/ymon/zubat.pic",0,1 ; 55, sprite dimensions
dw ZubatPicFront
dw ZubatPicBack
; attacks known at lvl 0
diff --git a/data/base_stats.asm b/data/base_stats.asm
index a84693a4..23e85e0f 100755
--- a/data/base_stats.asm
+++ b/data/base_stats.asm
@@ -148,3 +148,4 @@ INCLUDE "data/baseStats/dratini.asm"
INCLUDE "data/baseStats/dragonair.asm"
INCLUDE "data/baseStats/dragonite.asm"
INCLUDE "data/baseStats/mewtwo.asm"
+INCLUDE "data/baseStats/mew.asm"
diff --git a/data/bg_map_attributes.asm b/data/bg_map_attributes.asm
new file mode 100644
index 00000000..81535e72
--- /dev/null
+++ b/data/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/collision.asm b/data/collision.asm
index 78579242..8d35793d 100644
--- a/data/collision.asm
+++ b/data/collision.asm
@@ -22,3 +22,4 @@ Lab_Coll:: INCBIN "gfx/tilesets/lab.tilecoll"
Club_Coll:: INCBIN "gfx/tilesets/club.tilecoll"
Facility_Coll:: INCBIN "gfx/tilesets/facility.tilecoll"
Plateau_Coll:: INCBIN "gfx/tilesets/plateau.tilecoll"
+BeachHouse_Coll:: INCBIN "gfx/tilesets/beachhouse.tilecoll"
diff --git a/data/credit_mons.asm b/data/credit_mons.asm
index 23142f9f..15212048 100755
--- a/data/credit_mons.asm
+++ b/data/credit_mons.asm
@@ -14,3 +14,7 @@ CreditsMons:
db VILEPLUME
db NIDOKING
db PARASECT
+
+rept 9
+ db GENGAR
+endr
diff --git a/data/credits_order.asm b/data/credits_order.asm
index 20b9137f..c818ac07 100755
--- a/data/credits_order.asm
+++ b/data/credits_order.asm
@@ -2,38 +2,37 @@ CreditsOrder:
; subsequent credits elements will be displayed on separate lines.
; $FF, $FE, $FD, $FC, $FB, and $FA are commands that are used
; to go to the next set of credits texts.
- db CRED_MON, CRED_VERSION, $FF
- db CRED_DIRECTOR, CRED_TAJIRI, $FF
- db CRED_PROGRAMMERS, CRED_TA_OOTA, CRED_MORIMOTO, $FD
- db CRED_PROGRAMMERS, CRED_WATANABE, CRED_MASUDE, CRED_TAMADA, $FE
- db CRED_CHAR_DESIGN, CRED_SUGIMORI, CRED_NISHIDA, $FF
- db CRED_MUSIC, CRED_MASUDE, $FD
- db CRED_SOUND_EFFECTS, CRED_MASUDE, $FE
- db CRED_GAME_DESIGN, CRED_TAJIRI, $FF
- db CRED_MONSTER_DESIGN, CRED_SUGIMORI, CRED_NISHIDA, CRED_FUZIWARA, $FD
- db CRED_MONSTER_DESIGN, CRED_MORIMOTO, CRED_SA_OOTA, CRED_YOSHIKAWA, $FE
- db CRED_GAME_SCENE, CRED_TAJIRI, $FD
- db CRED_GAME_SCENE, CRED_TANIGUCHI, CRED_NONOMURA, CRED_ZINNAI, $FE
- db CRED_PARAM, CRED_NISINO, CRED_TA_NAKAMURA, $FF
- db CRED_MAP, CRED_TAJIRI, CRED_NISINO, $FD
- db CRED_MAP, CRED_MATSUSIMA, CRED_NONOMURA, CRED_TANIGUCHI, $FE
- db CRED_TEST, CRED_KAKEI, CRED_TSUCHIYA, $FD
- db CRED_TEST, CRED_TA_NAKAMURA, CRED_YUDA, $FE
- db CRED_SPECIAL, CRED_HISHIDA, CRED_SAKAI, $FD
- db CRED_SPECIAL, CRED_YAMAGUCHI, CRED_YAMAMOTO, $FC
- db CRED_SPECIAL, CRED_TOMISAWA, CRED_KAWAMOTO, CRED_TO_OOTA, $FE
- db CRED_PRODUCERS, CRED_MIYAMOTO, $FD
- db CRED_PRODUCERS, CRED_KAWAGUCHI, $FC
- db CRED_PRODUCERS, CRED_ISHIHARA, $FE
- db CRED_US_STAFF, $FD
- db CRED_US_COORD, CRED_TILDEN, $FD
- db CRED_US_COORD, CRED_KAWAKAMI, CRED_HI_NAKAMURA, $FC
- db CRED_US_COORD, CRED_GIESE, CRED_OSBORNE, $FC
- db CRED_TRANS, CRED_OGASAWARA, $FD
- db CRED_PROGRAMMERS, CRED_MURAKAWA, CRED_FUKUI, $FD
- db CRED_SPECIAL, CRED_IWATA, $FD
- db CRED_SPECIAL, CRED_HARADA, $FC
- db CRED_TEST, CRED_PAAD, CRED_CLUB, $FD
- db CRED_PRODUCER, CRED_IZUSHI, $FD
- db CRED_EXECUTIVE, CRED_YAMAUCHI, $FF
- db $FB, $FF, $FA
+ db CRED_POKEMON, CRED_VERSION, CRED_TEXT_FADE_MON
+ db CRED_DIRECTOR, CRED_TAJIRI, CRED_TEXT_FADE_MON
+ 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_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
+ db CRED_TEXT_FADE_MON
+ db CRED_THE_END
diff --git a/data/evos_moves.asm b/data/evos_moves.asm
index 26f09b87..27397eb0 100755
--- a/data/evos_moves.asm
+++ b/data/evos_moves.asm
@@ -222,11 +222,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:
@@ -271,7 +271,7 @@ NidokingEvosMoves:
db 0
; Learnset
db 8, HORN_ATTACK
- db 14, POISON_STING
+ db 12, DOUBLE_KICK
db 23, THRASH
db 0
@@ -360,11 +360,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:
@@ -372,7 +372,7 @@ NidoqueenEvosMoves:
db 0
; Learnset
db 8, SCRATCH
- db 14, POISON_STING
+ db 12, DOUBLE_KICK
db 23, BODY_SLAM
db 0
@@ -381,6 +381,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
@@ -486,6 +489,7 @@ ScytherEvosMoves:
db 29, SLASH
db 35, SWORDS_DANCE
db 42, AGILITY
+ db 50, WING_ATTACK
db 0
StaryuEvosMoves:
@@ -518,6 +522,7 @@ PinsirEvosMoves:
; Evolutions
db 0
; Learnset
+ db 21, BIND
db 25, SEISMIC_TOSS
db 30, GUILLOTINE
db 36, FOCUS_ENERGY
@@ -530,12 +535,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:
@@ -640,6 +647,7 @@ ChanseyEvosMoves:
; Evolutions
db 0
; Learnset
+ db 12, DOUBLESLAP
db 24, SING
db 30, GROWL
db 38, MINIMIZE
@@ -822,11 +830,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:
@@ -898,7 +908,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
@@ -1071,11 +1083,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:
@@ -1247,52 +1263,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:
@@ -1412,11 +1431,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:
@@ -1434,7 +1456,7 @@ VenomothEvosMoves:
; Evolutions
db 0
; Learnset
- db 24, POISONPOWDER
+ db 22, POISONPOWDER
db 27, LEECH_LIFE
db 30, STUN_SPORE
db 38, PSYBEAM
@@ -1477,19 +1499,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:
@@ -1669,6 +1693,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
@@ -1889,11 +1916,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:
@@ -1902,11 +1929,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/facing.asm b/data/facing.asm
index c412247a..944a31c8 100644
--- a/data/facing.asm
+++ b/data/facing.asm
@@ -1,57 +1,133 @@
SpriteFacingAndAnimationTable:
- dw SpriteFacingDownAndStanding, SpriteOAMParameters ; facing down, walk animation frame 0
- dw SpriteFacingDownAndWalking, SpriteOAMParameters ; facing down, walk animation frame 1
- dw SpriteFacingDownAndStanding, SpriteOAMParameters ; facing down, walk animation frame 2
- dw SpriteFacingDownAndWalking, SpriteOAMParametersFlipped ; facing down, walk animation frame 3
- dw SpriteFacingUpAndStanding, SpriteOAMParameters ; facing up, walk animation frame 0
- dw SpriteFacingUpAndWalking, SpriteOAMParameters ; facing up, walk animation frame 1
- dw SpriteFacingUpAndStanding, SpriteOAMParameters ; facing up, walk animation frame 2
- dw SpriteFacingUpAndWalking, SpriteOAMParametersFlipped ; facing up, walk animation frame 3
- dw SpriteFacingLeftAndStanding, SpriteOAMParameters ; facing left, walk animation frame 0
- dw SpriteFacingLeftAndWalking, SpriteOAMParameters ; facing left, walk animation frame 1
- dw SpriteFacingLeftAndStanding, SpriteOAMParameters ; facing left, walk animation frame 2
- dw SpriteFacingLeftAndWalking, SpriteOAMParameters ; facing left, walk animation frame 3
- dw SpriteFacingLeftAndStanding, SpriteOAMParametersFlipped ; facing right, walk animation frame 0
- dw SpriteFacingLeftAndWalking, SpriteOAMParametersFlipped ; facing right, walk animation frame 1
- dw SpriteFacingLeftAndStanding, SpriteOAMParametersFlipped ; facing right, walk animation frame 2
- dw SpriteFacingLeftAndWalking, SpriteOAMParametersFlipped ; facing right, walk animation frame 3
- dw SpriteFacingDownAndStanding, SpriteOAMParameters ; ---
- dw SpriteFacingDownAndStanding, SpriteOAMParameters ; This table is used for sprites $a and $b.
- dw SpriteFacingDownAndStanding, SpriteOAMParameters ; All orientation and animation parameters
- dw SpriteFacingDownAndStanding, SpriteOAMParameters ; lead to the same result. Used for immobile
- dw SpriteFacingDownAndStanding, SpriteOAMParameters ; sprites like items on the ground
- dw SpriteFacingDownAndStanding, SpriteOAMParameters ; ---
- dw SpriteFacingDownAndStanding, SpriteOAMParameters
- dw SpriteFacingDownAndStanding, SpriteOAMParameters
- dw SpriteFacingDownAndStanding, SpriteOAMParameters
- dw SpriteFacingDownAndStanding, SpriteOAMParameters
- dw SpriteFacingDownAndStanding, SpriteOAMParameters
- dw SpriteFacingDownAndStanding, SpriteOAMParameters
- dw SpriteFacingDownAndStanding, SpriteOAMParameters
- dw SpriteFacingDownAndStanding, SpriteOAMParameters
- dw SpriteFacingDownAndStanding, SpriteOAMParameters
- dw SpriteFacingDownAndStanding, SpriteOAMParameters
+ dw SpriteFacingDownAndStanding ; facing down, walk animation frame 0
+ dw SpriteFacingDownAndWalking ; facing down, walk animation frame 1
+ dw SpriteFacingDownAndStanding ; facing down, walk animation frame 2
+ dw SpriteFacingDownAndWalking2 ; facing down, walk animation frame 3
+
+ dw SpriteFacingUpAndStanding ; facing up, walk animation frame 0
+ dw SpriteFacingUpAndWalking ; facing up, walk animation frame 1
+ dw SpriteFacingUpAndStanding ; facing up, walk animation frame 2
+ dw SpriteFacingUpAndWalking2 ; facing up, walk animation frame 3
+
+ dw SpriteFacingLeftAndStanding ; facing left, walk animation frame 0
+ dw SpriteFacingLeftAndWalking ; facing left, walk animation frame 1
+ dw SpriteFacingLeftAndStanding ; facing left, walk animation frame 2
+ dw SpriteFacingLeftAndWalking ; facing left, walk animation frame 3
+
+ dw SpriteFacingRightAndStanding ; facing right, walk animation frame 0
+ dw SpriteFacingRightAndWalking ; facing right, walk animation frame 1
+ dw SpriteFacingRightAndStanding ; facing right, walk animation frame 2
+ dw SpriteFacingRightAndWalking ; facing right, walk animation frame 3
+
+ dw SpriteFacingDownAndStanding ; ---
+ dw SpriteFacingDownAndStanding ; This table is used for sprites $a and $b.
+ dw SpriteFacingDownAndStanding ; All orientation and animation parameters
+ dw SpriteFacingDownAndStanding ; lead to the same result. Used for immobile
+ dw SpriteFacingDownAndStanding ; sprites like items on the ground
+ dw SpriteFacingDownAndStanding ; ---
+ dw SpriteFacingDownAndStanding
+ dw SpriteFacingDownAndStanding
+ dw SpriteFacingDownAndStanding
+ dw SpriteFacingDownAndStanding
+ dw SpriteFacingDownAndStanding
+ dw SpriteFacingDownAndStanding
+ dw SpriteFacingDownAndStanding
+ dw SpriteFacingDownAndStanding
+ dw SpriteFacingDownAndStanding
+ dw SpriteFacingDownAndStanding
+; special case
+ dw SpriteSpecialCase ; pikachu maybe?
SpriteFacingDownAndStanding:
- db $00,$01,$02,$03
+ db $04
+; Sprite OAM Parameters
+ db $00,$00,$00,$00 ; top left
+ db $00,$08,$01,$00 ; top right
+ db $08,$00,$02,OAMFLAG_CANBEMASKED ; bottom left
+ db $08,$08,$03,OAMFLAG_CANBEMASKED | OAMFLAG_ENDOFDATA ; bottom right
+
SpriteFacingDownAndWalking:
- db $80,$81,$82,$83
+ db $04
+; Sprite OAM Parameters
+ db $00,$00,$80,$00 ; top left
+ db $00,$08,$81,$00 ; top right
+ db $08,$00,$82,OAMFLAG_CANBEMASKED ; bottom left
+ db $08,$08,$83,OAMFLAG_CANBEMASKED | OAMFLAG_ENDOFDATA ; bottom right
+
+SpriteFacingDownAndWalking2:
+ db $04
+; Sprite OAM Parameters
+ db $00,$08,$80,OAMFLAG_VFLIPPED ; top left
+ db $00,$00,$81,OAMFLAG_VFLIPPED ; top right
+ db $08,$08,$82,OAMFLAG_VFLIPPED | OAMFLAG_CANBEMASKED ; bottom left
+ db $08,$00,$83,OAMFLAG_VFLIPPED | OAMFLAG_CANBEMASKED | OAMFLAG_ENDOFDATA ; bottom right
+
SpriteFacingUpAndStanding:
- db $04,$05,$06,$07
+ db $04
+; Sprite OAM Parameters
+ db $00,$00,$04,$00 ; top left
+ db $00,$08,$05,$00 ; top right
+ db $08,$00,$06,OAMFLAG_CANBEMASKED ; bottom left
+ db $08,$08,$07,OAMFLAG_CANBEMASKED | OAMFLAG_ENDOFDATA ; bottom right
+
SpriteFacingUpAndWalking:
- db $84,$85,$86,$87
+ db $04
+; Sprite OAM Parameters
+ db $00,$00,$84,$00 ; top left
+ db $00,$08,$85,$00 ; top right
+ db $08,$00,$86,OAMFLAG_CANBEMASKED ; bottom left
+ db $08,$08,$87,OAMFLAG_CANBEMASKED | OAMFLAG_ENDOFDATA ; bottom right
+
+SpriteFacingUpAndWalking2:
+ db $04
+; Sprite OAM Parameters
+ db $00,$08,$84,OAMFLAG_VFLIPPED ; top left
+ db $00,$00,$85,OAMFLAG_VFLIPPED ; top right
+ db $08,$08,$86,OAMFLAG_VFLIPPED | OAMFLAG_CANBEMASKED ; bottom left
+ db $08,$00,$87,OAMFLAG_VFLIPPED | OAMFLAG_CANBEMASKED | OAMFLAG_ENDOFDATA ; bottom right
+
SpriteFacingLeftAndStanding:
- db $08,$09,$0a,$0b
+ db $04
+; Sprite OAM Parameters
+ db $00,$00,$08,$00 ; top left
+ db $00,$08,$09,$00 ; top right
+ db $08,$00,$0a,OAMFLAG_CANBEMASKED ; bottom left
+ db $08,$08,$0b,OAMFLAG_CANBEMASKED | OAMFLAG_ENDOFDATA ; bottom right
+
SpriteFacingLeftAndWalking:
- db $88,$89,$8a,$8b
-
-SpriteOAMParameters:
- db $00,$00, $00 ; top left
- db $00,$08, $00 ; top right
- db $08,$00, OAMFLAG_CANBEMASKED ; bottom left
- db $08,$08, OAMFLAG_CANBEMASKED | OAMFLAG_ENDOFDATA ; bottom right
-SpriteOAMParametersFlipped:
- db $00,$08, OAMFLAG_VFLIPPED
- db $00,$00, OAMFLAG_VFLIPPED
- db $08,$08, OAMFLAG_VFLIPPED | OAMFLAG_CANBEMASKED
- db $08,$00, OAMFLAG_VFLIPPED | OAMFLAG_CANBEMASKED | OAMFLAG_ENDOFDATA
+ db $04
+; Sprite OAM Parameters
+ db $00,$00,$88,$00 ; top left
+ db $00,$08,$89,$00 ; top right
+ db $08,$00,$8a,OAMFLAG_CANBEMASKED ; bottom left
+ db $08,$08,$8b,OAMFLAG_CANBEMASKED | OAMFLAG_ENDOFDATA ; bottom right
+
+SpriteFacingRightAndStanding:
+ db $04
+; Sprite OAM Parameters
+ db $00,$08,$08,OAMFLAG_VFLIPPED ; top left
+ db $00,$00,$09,OAMFLAG_VFLIPPED ; top right
+ db $08,$08,$0a,OAMFLAG_VFLIPPED | OAMFLAG_CANBEMASKED ; bottom left
+ db $08,$00,$0b,OAMFLAG_VFLIPPED | OAMFLAG_CANBEMASKED | OAMFLAG_ENDOFDATA ; bottom right
+
+SpriteFacingRightAndWalking:
+ db $04
+; Sprite OAM Parameters
+ db $00,$08,$88,OAMFLAG_VFLIPPED ; top left
+ db $00,$00,$89,OAMFLAG_VFLIPPED ; top right
+ db $08,$08,$8a,OAMFLAG_VFLIPPED | OAMFLAG_CANBEMASKED ; bottom left
+ db $08,$00,$8b,OAMFLAG_VFLIPPED | OAMFLAG_CANBEMASKED | OAMFLAG_ENDOFDATA ; bottom right
+
+SpriteSpecialCase
+ db $09
+; Sprite OAM Parameters
+ db -$4,-$4,$00,$00
+ db -$4,$04,$01,$00
+ db -$4,$0c,$00,OAMFLAG_VFLIPPED
+ db $04,-$4,$01,$00
+ db $04,$04,$02,$00
+ db $04,$0c,$01,$00
+ db $0c,-$4,$00,OAM_VFLIP | OAMFLAG_CANBEMASKED
+ db $0c,$04,$01,OAMFLAG_CANBEMASKED
+ db $0c,$0c,$00,OAM_VFLIP | OAM_HFLIP | OAMFLAG_CANBEMASKED | OAMFLAG_ENDOFDATA
+
diff --git a/data/hidden_item_coords.asm b/data/hidden_item_coords.asm
index 6b911dea..acc79172 100755
--- a/data/hidden_item_coords.asm
+++ b/data/hidden_item_coords.asm
@@ -1,57 +1,58 @@
HiddenItemCoords:
; map ID, then coords
+ db SILPH_CO_5F,$03,$0c
+ db SILPH_CO_9F,$0f,$02
+ db POKEMON_MANSION_3F,$09,$01
+ db POKEMON_MANSION_B1F,$09,$01
+ db SAFARI_ZONE_WEST,$05,$06
+ db CERULEAN_CAVE_2F,$0d,$10
+ db CERULEAN_CAVE_B1F,$0e,$08
+ db UNUSED_MAP_6F,$0b,$0e
+ db SEAFOAM_ISLANDS_B2F,$0f,$0f
+ db SEAFOAM_ISLANDS_B3F,$10,$09
+ db SEAFOAM_ISLANDS_B4F,$11,$19
db VIRIDIAN_FOREST,$12,$01
db VIRIDIAN_FOREST,$2a,$10
db MT_MOON_B2F,$0c,$12
- db ROUTE_25,$03,$26
- db ROUTE_9,$07,$0e
- db SS_ANNE_KITCHEN,$09,$0d
+ db MT_MOON_B2F,$09,$21
db SS_ANNE_B1F_ROOMS,$01,$03
- db ROUTE_10,$11,$09
- db ROUTE_10,$35,$10
+ db SS_ANNE_KITCHEN,$09,$0d
+ db UNDERGROUND_PATH_NORTH_SOUTH,$04,$03
+ db UNDERGROUND_PATH_NORTH_SOUTH,$22,$04
+ db UNDERGROUND_PATH_WEST_EAST,$02,$0c
+ db UNDERGROUND_PATH_WEST_EAST,$05,$15
db ROCKET_HIDEOUT_B1F,$0f,$15
db ROCKET_HIDEOUT_B3F,$11,$1b
db ROCKET_HIDEOUT_B4F,$01,$19
- db POKEMON_TOWER_5F,$0c,$04
- db ROUTE_13,$0e,$01
- db ROUTE_13,$0d,$10
- db POKEMON_MANSION_B1F,$09,$01
- db SAFARI_ZONE_GATE,$01,$0a
- db SAFARI_ZONE_WEST,$05,$06
- db SILPH_CO_5F,$03,$0c
- db SILPH_CO_9F,$0f,$02
- db COPYCATS_HOUSE_2F,$01,$01
- db CERULEAN_CAVE_1F,$0b,$0e
- db CERULEAN_CAVE_B1F,$03,$1b
+ db ROUTE_10,$11,$09
+ db ROUTE_10,$35,$10
db POWER_PLANT,$10,$11
db POWER_PLANT,$01,$0c
- db SEAFOAM_ISLANDS_B2F,$0f,$0f
- db SEAFOAM_ISLANDS_B4F,$11,$19
- db POKEMON_MANSION_1F,$10,$08
- db POKEMON_MANSION_3F,$09,$01
- db ROUTE_23,$2c,$09
- db ROUTE_23,$46,$13
- db ROUTE_23,$5a,$08
- db VICTORY_ROAD_2F,$02,$05
- db VICTORY_ROAD_2F,$07,$1a
- db UNUSED_MAP_6F,$0b,$0e
- db VIRIDIAN_CITY,$04,$0e
db ROUTE_11,$05,$30
db ROUTE_12,$3f,$02
+ db ROUTE_13,$0e,$01
+ db ROUTE_13,$0d,$10
db ROUTE_17,$0e,$0f
db ROUTE_17,$2d,$08
db ROUTE_17,$48,$11
db ROUTE_17,$5b,$04
db ROUTE_17,$79,$08
- db UNDERGROUND_PATH_NORTH_SOUTH,$04,$03
- db UNDERGROUND_PATH_NORTH_SOUTH,$22,$04
- db UNDERGROUND_PATH_WEST_EAST,$02,$0c
- db UNDERGROUND_PATH_WEST_EAST,$05,$15
- db CELADON_CITY,$0f,$30
+ db ROUTE_23,$2c,$09
+ db ROUTE_23,$46,$13
+ db ROUTE_23,$5a,$08
+ db VICTORY_ROAD_2F,$02,$05
+ db VICTORY_ROAD_2F,$07,$1a
+ db ROUTE_25,$03,$26
db ROUTE_25,$01,$0a
- db MT_MOON_B2F,$09,$21
- db SEAFOAM_ISLANDS_B3F,$10,$09
- db VERMILION_CITY,$0b,$0e
- db CERULEAN_CITY,$08,$0f
db ROUTE_4,$03,$28
+ db ROUTE_9,$07,$0e
+ db COPYCATS_HOUSE_2F,$01,$01
+ db VIRIDIAN_CITY,$04,$0e
+ db CERULEAN_CITY,$08,$0f
+ db CERULEAN_CAVE_1F,$07,$12
+ db POKEMON_TOWER_5F,$0c,$04
+ db VERMILION_CITY,$0b,$0e
+ db CELADON_CITY,$0f,$30
+ db SAFARI_ZONE_GATE,$01,$0a
+ db POKEMON_MANSION_1F,$10,$08
db $ff
diff --git a/data/hidden_objects.asm b/data/hidden_objects.asm
index 737947a7..f4865bb9 100755
--- a/data/hidden_objects.asm
+++ b/data/hidden_objects.asm
@@ -1,853 +1,545 @@
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 $FF
-
-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 $ff
; format: y-coord, x-coord, text id/item id, object routine
+hidden_object: macro
+ db \1, \2, \3
+ dba \4
+ endm
+
+SilphCo11FHiddenObjects:
+ hidden_object 12, 10, SPRITE_FACING_UP, OpenPokemonCenterPC
+ db $ff
+
+SilphCo5FHiddenObjects:
+ hidden_object 3, 12, ELIXER, HiddenItems
+ db $ff
+
+SilphCo9FHiddenObjects:
+ hidden_object 15, 2, MAX_POTION, HiddenItems
+ db $ff
+
+Mansion2HiddenObjects:
+ hidden_object 11, 2, SPRITE_FACING_UP, Mansion2Script_Switches
+ db $ff
+
+Mansion3HiddenObjects:
+ hidden_object 9, 1, MAX_REVIVE, HiddenItems
+ hidden_object 5, 10, SPRITE_FACING_UP, Mansion3Script_Switches
+ db $ff
+
+Mansion4HiddenObjects:
+ hidden_object 9, 1, RARE_CANDY, HiddenItems
+ hidden_object 3, 20, SPRITE_FACING_UP, Mansion4Script_Switches
+ hidden_object 25, 18, SPRITE_FACING_UP, Mansion4Script_Switches
+ db $ff
+
+SafariZoneWestHiddenObjects:
+ hidden_object 5, 6, REVIVE, HiddenItems
+ db $ff
+
+CeruleanCave2HiddenObjects:
+ hidden_object 13, 16, PP_UP, HiddenItems
+ db $ff
+
+CeruleanCave3HiddenObjects:
+ hidden_object 14, 8, PP_UP, HiddenItems
+ db $ff
+
+UnusedMap6FHiddenObjects:
+ hidden_object 11, 14, MAX_ELIXER, HiddenItems
+ db $ff
+
+SeafoamIslands3HiddenObjects:
+ hidden_object 15, 15, NUGGET, HiddenItems
+ db $ff
+
+SeafoamIslands4HiddenObjects:
+ hidden_object 16, 9, MAX_ELIXER, HiddenItems
+ db $ff
+
+SeafoamIslands5HiddenObjects:
+ hidden_object 17, 25, ULTRA_BALL, HiddenItems
+ db $ff
+
+ViridianForestHiddenObjects:
+ hidden_object 18, 1, POTION, HiddenItems
+ hidden_object 42, 16, ANTIDOTE, HiddenItems
+ db $ff
+
+MtMoon3HiddenObjects:
+ hidden_object 12, 18, MOON_STONE, HiddenItems
+ hidden_object 9, 33, ETHER, HiddenItems
+ db $ff
+
+SSAnne10HiddenObjects:
+ hidden_object 1, 3, HYPER_POTION, HiddenItems
+ db $ff
+
+SSAnne6HiddenObjects:
+ hidden_object 5, 13, SPRITE_FACING_DOWN, PrintTrashText
+ hidden_object 7, 13, SPRITE_FACING_DOWN, PrintTrashText
+ hidden_object 9, 13, GREAT_BALL, HiddenItems
+ db $ff
+
+UndergroundPathNsHiddenObjects:
+ hidden_object 4, 3, FULL_RESTORE, HiddenItems
+ hidden_object 34, 4, X_SPECIAL, HiddenItems
+ db $ff
+
+UndergroundPathWeHiddenObjects:
+ hidden_object 2, 12, NUGGET, HiddenItems
+ hidden_object 5, 21, ELIXER, HiddenItems
+ db $ff
+
+RocketHideout1HiddenObjects:
+ hidden_object 15, 21, PP_UP, HiddenItems
+ db $ff
+
+RocketHideout3HiddenObjects:
+ hidden_object 17, 27, NUGGET, HiddenItems
+ db $ff
+
+RocketHideout4HiddenObjects:
+ hidden_object 1, 25, SUPER_POTION, HiddenItems
+ db $ff
+
+Route10HiddenObjects:
+ hidden_object 17, 9, SUPER_POTION, HiddenItems
+ hidden_object 53, 16, MAX_ETHER, HiddenItems
+ db $ff
+
+RockTunnelPokecenterHiddenObjects:
+ hidden_object 4, 0, SPRITE_FACING_LEFT, PrintBenchGuyText
+ hidden_object 3, 13, SPRITE_FACING_UP, OpenPokemonCenterPC
+ db $ff
+
+PowerPlantHiddenObjects:
+ hidden_object 16, 17, MAX_ELIXER, HiddenItems
+ hidden_object 1, 12, PP_UP, HiddenItems
+ db $ff
+
+Route11HiddenObjects:
+ hidden_object 5, 48, ESCAPE_ROPE, HiddenItems
+ db $ff
+
+Route12HiddenObjects:
+ hidden_object 63, 2, HYPER_POTION, HiddenItems
+ db $ff
+
+Route13HiddenObjects:
+ hidden_object 14, 1, PP_UP, HiddenItems
+ hidden_object 13, 16, CALCIUM, HiddenItems
+ db $ff
+
+Route15Gate2FHiddenObjects:
+ hidden_object 2, 1, SPRITE_FACING_UP, Route15GateLeftBinoculars
+ db $ff
+
+Route17HiddenObjects:
+ hidden_object 14, 15, RARE_CANDY, HiddenItems
+ hidden_object 45, 8, FULL_RESTORE, HiddenItems
+ hidden_object 72, 17, PP_UP, HiddenItems
+ hidden_object 91, 4, MAX_REVIVE, HiddenItems
+ hidden_object 121, 8, MAX_ELIXER, HiddenItems
+ db $ff
+
+Route23HiddenObjects:
+ hidden_object 44, 9, FULL_RESTORE, HiddenItems
+ hidden_object 70, 19, ULTRA_BALL, HiddenItems
+ hidden_object 90, 8, MAX_ETHER, HiddenItems
+ db $ff
+
+VictoryRoad2HiddenObjects:
+ hidden_object 2, 5, ULTRA_BALL, HiddenItems
+ hidden_object 7, 26, FULL_RESTORE, HiddenItems
+ db $ff
+
+Route25HiddenObjects:
+ hidden_object 3, 38, ETHER, HiddenItems
+ hidden_object 1, 10, ELIXER, HiddenItems
+ db $ff
+
+BillsHouseHiddenObjects:
+ hidden_object 4, 1, SPRITE_FACING_UP, BillsHousePC
+ db $ff
+
+Route4HiddenObjects:
+ hidden_object 3, 40, GREAT_BALL, HiddenItems
+ db $ff
+
+MtMoonPokecenterHiddenObjects:
+ hidden_object 4, 0, SPRITE_FACING_LEFT, PrintBenchGuyText
+ hidden_object 3, 13, SPRITE_FACING_UP, OpenPokemonCenterPC
+ db $ff
+
+Route9HiddenObjects:
+ hidden_object 7, 14, ETHER, HiddenItems
+ db $ff
+
TradeCenterHiddenObjects:
- db $04,$05,$d0
- db BANK(CableClubRightGameboy)
- dw CableClubRightGameboy
- db $04,$04,$d0
- db BANK(CableClubLeftGameboy)
- dw CableClubLeftGameboy
- db $FF
+ hidden_object 4, 5, $d0, CableClubRightGameboy
+ hidden_object 4, 4, $d0, CableClubLeftGameboy
+ db $ff
+
ColosseumHiddenObjects:
- db $04,$05,$d0
- db BANK(CableClubRightGameboy)
- dw CableClubRightGameboy
- db $04,$04,$d0
- db BANK(CableClubLeftGameboy)
- dw CableClubLeftGameboy
- db $FF
+ hidden_object 4, 5, $d0, CableClubRightGameboy
+ hidden_object 4, 4, $d0, CableClubLeftGameboy
+ db $ff
+
+IndigoPlateauHiddenObjects:
+ hidden_object 13, 8, $ff, PrintIndigoPlateauHQText
+ hidden_object 13, 11, SPRITE_FACING_DOWN, PrintIndigoPlateauHQText
+ db $ff
+
+IndigoPlateauLobbyHiddenObjects:
+ hidden_object 7, 15, SPRITE_FACING_UP, OpenPokemonCenterPC
+ db $ff
+
+CopycatsHouse2FHiddenObjects:
+ hidden_object 1, 1, NUGGET, HiddenItems
+ db $ff
+
+FightingDojoHiddenObjects:
+ hidden_object 9, 3, SPRITE_FACING_UP, PrintFightingDojoText
+ hidden_object 9, 6, SPRITE_FACING_UP, PrintFightingDojoText
+ hidden_object 0, 4, SPRITE_FACING_UP, PrintFightingDojoText2
+ hidden_object 0, 5, SPRITE_FACING_UP, PrintFightingDojoText3
+ db $ff
+
+SaffronGymHiddenObjects:
+ hidden_object 15, 9, SPRITE_FACING_UP, GymStatues
+ db $ff
+
+SaffronPokecenterHiddenObjects:
+ hidden_object 4, 0, SPRITE_FACING_UP, PrintBenchGuyText
+ hidden_object 3, 13, SPRITE_FACING_UP, OpenPokemonCenterPC
+ db $ff
+
RedsHouse2FHiddenObjects:
- db $01,$00,$04
- dbw BANK(OpenRedsPC), OpenRedsPC
- db $05,$03,$d0
- dbw BANK(PrintRedSNESText), PrintRedSNESText
- db $FF
+ hidden_object 1, 0, SPRITE_FACING_UP, OpenRedsPC
+ hidden_object 5, 3, $d0, PrintRedSNESText
+ db $ff
+
BluesHouseHiddenObjects:
- db $01,$00,$04
- db BANK(PrintBookcaseText)
- dw PrintBookcaseText
- db $01,$01,$04
- db BANK(PrintBookcaseText)
- dw PrintBookcaseText
- db $01,$07,$04
- db BANK(PrintBookcaseText)
- dw PrintBookcaseText
- db $FF
+ hidden_object 1, 0, SPRITE_FACING_UP, PrintBookcaseText
+ hidden_object 1, 1, SPRITE_FACING_UP, PrintBookcaseText
+ hidden_object 1, 7, SPRITE_FACING_UP, PrintBookcaseText
+ db $ff
+
OaksLabHiddenObjects:
- db $00,$04,$04
- db BANK(DisplayOakLabLeftPoster)
- dw DisplayOakLabLeftPoster
- db $00,$05,$04
- db BANK(DisplayOakLabRightPoster)
- dw DisplayOakLabRightPoster
- db $01,$00,$04
- db BANK(DisplayOakLabEmailText)
- dw DisplayOakLabEmailText
- db $01,$01,$04
- db BANK(DisplayOakLabEmailText)
- dw DisplayOakLabEmailText
- db $FF
+ hidden_object 0, 4, SPRITE_FACING_UP, DisplayOakLabLeftPoster
+ hidden_object 0, 5, SPRITE_FACING_UP, DisplayOakLabRightPoster
+ hidden_object 1, 0, SPRITE_FACING_UP, DisplayOakLabEmailText
+ hidden_object 1, 1, SPRITE_FACING_UP, DisplayOakLabEmailText
+ db $ff
+
+ViridianCityHiddenObjects:
+ hidden_object 4, 14, POTION, HiddenItems
+ db $ff
+
ViridianPokecenterHiddenObjects:
- db $04,$00,$08
- db Bank(PrintBenchGuyText)
- dw PrintBenchGuyText
- db $03,$0d,$04
- db BANK(OpenPokemonCenterPC)
- dw OpenPokemonCenterPC
- db $FF
-ViridianMartHiddenObjects:
- db $FF
+ hidden_object 4, 0, SPRITE_FACING_LEFT, PrintBenchGuyText
+ hidden_object 3, 13, SPRITE_FACING_UP, OpenPokemonCenterPC
+ db $ff
+
ViridianSchoolHiddenObjects:
- db $04,$03,(ViridianSchoolNotebook_id - TextPredefs) / 2 + 1
- db Bank(PrintNotebookText)
- dw PrintNotebookText
- db $00,$03,(ViridianSchoolBlackboard_id - TextPredefs) / 2 + 1
- db BANK(PrintBlackboardLinkCableText)
- dw PrintBlackboardLinkCableText
- db $FF
+ hidden_object 4, 3, (ViridianSchoolNotebook_id - TextPredefs) / 2 + 1, PrintNotebookText
+ hidden_object 0, 3, (ViridianSchoolBlackboard_id - TextPredefs) / 2 + 1, PrintBlackboardLinkCableText
+ db $ff
+
ViridianGymHiddenObjects:
- db $0f,$0f,$04
- dbw BANK(GymStatues),GymStatues
- db $0f,$12,$04
- dbw BANK(GymStatues),GymStatues
- db $FF
+ hidden_object 15, 15, SPRITE_FACING_UP, GymStatues
+ hidden_object 15, 18, SPRITE_FACING_UP, GymStatues
+ db $ff
+
Museum1FHiddenObjects:
- db $03,$02,$04
- dbw BANK(AerodactylFossil), AerodactylFossil
- db $06,$02,$04
- dbw BANK(KabutopsFossil), KabutopsFossil
- db $FF
+ hidden_object 3, 2, SPRITE_FACING_UP, AerodactylFossil
+ hidden_object 6, 2, SPRITE_FACING_UP, KabutopsFossil
+ db $ff
+
PewterGymHiddenObjects:
- db $0a,$03,$04
- dbw BANK(GymStatues),GymStatues
- db $0a,$06,$04
- dbw BANK(GymStatues),GymStatues
- db $FF
-PewterMartHiddenObjects:
- db $FF
+ hidden_object 10, 3, SPRITE_FACING_UP, GymStatues
+ hidden_object 10, 6, SPRITE_FACING_UP, GymStatues
+ db $ff
+
PewterPokecenterHiddenObjects:
- db $04,$00,$08
- db Bank(PrintBenchGuyText)
- dw PrintBenchGuyText
- db $03,$0d,$04
- db BANK(OpenPokemonCenterPC)
- dw OpenPokemonCenterPC
- db $FF
+ hidden_object 4, 0, SPRITE_FACING_LEFT, PrintBenchGuyText
+ hidden_object 3, 13, SPRITE_FACING_UP, OpenPokemonCenterPC
+ db $ff
+
+CeruleanCityHiddenObjects:
+ hidden_object 8, 15, RARE_CANDY, HiddenItems
+ db $ff
+
CeruleanPokecenterHiddenObjects:
- db $04,$00,$08
- db Bank(PrintBenchGuyText)
- dw PrintBenchGuyText
- db $03,$0d,$04
- db BANK(OpenPokemonCenterPC)
- dw OpenPokemonCenterPC
- db $FF
+ hidden_object 4, 0, SPRITE_FACING_LEFT, PrintBenchGuyText
+ hidden_object 3, 13, SPRITE_FACING_UP, OpenPokemonCenterPC
+ db $ff
+
CeruleanGymHiddenObjects:
- db $0b,$03,$04
- dbw BANK(GymStatues),GymStatues
- db $0b,$06,$04
- dbw BANK(GymStatues),GymStatues
- db $FF
-CeruleanMartHiddenObjects:
- db $FF
+ hidden_object 11, 3, SPRITE_FACING_UP, GymStatues
+ hidden_object 11, 6, SPRITE_FACING_UP, GymStatues
+ db $ff
+
+BikeShopHiddenObjects:
+ hidden_object 0, 1, $d0, PrintNewBikeText
+ hidden_object 1, 2, $d0, PrintNewBikeText
+ hidden_object 2, 1, $d0, PrintNewBikeText
+ hidden_object 2, 3, $d0, PrintNewBikeText
+ hidden_object 4, 0, $d0, PrintNewBikeText
+ hidden_object 5, 1, $d0, PrintNewBikeText
+ db $ff
+
+CeruleanCave1HiddenObjects:
+ hidden_object 7, 18, PP_UP, HiddenItems
+ db $ff
+
LavenderPokecenterHiddenObjects:
- db $04,$00,$08
- db Bank(PrintBenchGuyText)
- dw PrintBenchGuyText
- db $03,$0d,$04
- db BANK(OpenPokemonCenterPC)
- dw OpenPokemonCenterPC
- db $FF
+ hidden_object 4, 0, SPRITE_FACING_LEFT, PrintBenchGuyText
+ hidden_object 3, 13, SPRITE_FACING_UP, OpenPokemonCenterPC
+ db $ff
+
+Pokemontower5HiddenObjects:
+ hidden_object 12, 4, ELIXER, HiddenItems
+ db $ff
+
+LavenderHouse1HiddenObjects:
+ hidden_object 1, 0, SPRITE_FACING_DOWN, PrintMagazinesText
+ hidden_object 1, 1, SPRITE_FACING_DOWN, PrintMagazinesText
+ hidden_object 1, 7, SPRITE_FACING_DOWN, PrintMagazinesText
+ db $ff
+
+VermilionCityHiddenObjects:
+ hidden_object 11, 14, MAX_ETHER, HiddenItems
+ db $ff
+
VermilionPokecenterHiddenObjects:
- db $03,$0d,$04
- db BANK(OpenPokemonCenterPC)
- dw OpenPokemonCenterPC
- db $04,$00,$04
- db Bank(PrintBenchGuyText)
- dw PrintBenchGuyText
- db $FF
+ hidden_object 3, 13, SPRITE_FACING_UP, OpenPokemonCenterPC
+ hidden_object 4, 0, SPRITE_FACING_UP, PrintBenchGuyText
+ db $ff
+
+PokemonFanClubHiddenObjects:
+ hidden_object 0, 1, SPRITE_FACING_UP, FanClubPicture1
+ hidden_object 0, 6, SPRITE_FACING_UP, FanClubPicture2
+ db $ff
+
VermilionGymHiddenObjects:
- db $0e,$03,$04
- dbw BANK(GymStatues), GymStatues
- db $0e,$06,$04
- dbw BANK(GymStatues), GymStatues
- db $01,$06,$00
- dbw BANK(PrintTrashText), PrintTrashText
- db $07,$01,$00
- dbw BANK(GymTrashScript), GymTrashScript
- db $09,$01,$01
- dbw BANK(GymTrashScript), GymTrashScript
- db $0b,$01,$02
- dbw BANK(GymTrashScript), GymTrashScript
- db $07,$03,$03
- dbw BANK(GymTrashScript), GymTrashScript
- db $09,$03,$04
- dbw BANK(GymTrashScript), GymTrashScript
- db $0b,$03,$05
- dbw BANK(GymTrashScript), GymTrashScript
- db $07,$05,$06
- dbw BANK(GymTrashScript), GymTrashScript
- db $09,$05,$07
- dbw BANK(GymTrashScript), GymTrashScript
- db $0b,$05,$08
- dbw BANK(GymTrashScript), GymTrashScript
- db $07,$07,$09
- dbw BANK(GymTrashScript), GymTrashScript
- db $09,$07,$0a
- dbw BANK(GymTrashScript), GymTrashScript
- db $0b,$07,$0b
- dbw BANK(GymTrashScript), GymTrashScript
- db $07,$09,$0c
- dbw BANK(GymTrashScript), GymTrashScript
- db $09,$09,$0d
- dbw BANK(GymTrashScript), GymTrashScript
- db $0b,$09,$0e
- dbw BANK(GymTrashScript), GymTrashScript
- db $FF
+ hidden_object 14, 3, SPRITE_FACING_UP, GymStatues
+ hidden_object 14, 6, SPRITE_FACING_UP, GymStatues
+ hidden_object 1, 6, SPRITE_FACING_DOWN, PrintTrashText
+ hidden_object 7, 1, 0, GymTrashScript
+ hidden_object 9, 1, 1, GymTrashScript
+ hidden_object 11, 1, 2, GymTrashScript
+ hidden_object 7, 3, 3, GymTrashScript
+ hidden_object 9, 3, 4, GymTrashScript
+ hidden_object 11, 3, 5, GymTrashScript
+ hidden_object 7, 5, 6, GymTrashScript
+ hidden_object 9, 5, 7, GymTrashScript
+ hidden_object 11, 5, 8, GymTrashScript
+ hidden_object 7, 7, 9, GymTrashScript
+ hidden_object 9, 7, 10, GymTrashScript
+ hidden_object 11, 7, 11, GymTrashScript
+ hidden_object 7, 9, 12, GymTrashScript
+ hidden_object 9, 9, 13, GymTrashScript
+ hidden_object 11, 9, 14, GymTrashScript
+ db $ff
+
+CeladonCityHiddenObjects:
+ hidden_object 15, 48, PP_UP, HiddenItems
+ db $ff
+
+CeladonHotelHiddenObjects:
+ hidden_object 4, 0, SPRITE_FACING_LEFT, PrintBenchGuyText
+ db $ff
+
CeladonMansion2HiddenObjects:
- db $05,$00,$04
- db BANK(OpenPokemonCenterPC)
- dw OpenPokemonCenterPC
- db $FF
+ hidden_object 5, 0, SPRITE_FACING_UP, OpenPokemonCenterPC
+ db $ff
+
+CeladonMansion5HiddenObjects:
+ hidden_object 0, 3, (LinkCableHelp_id - TextPredefs) / 2 + 1, PrintBlackboardLinkCableText
+ hidden_object 0, 4, (LinkCableHelp_id - TextPredefs) / 2 + 1, PrintBlackboardLinkCableText
+ hidden_object 4, 3, (TMNotebook_id - TextPredefs) / 2 + 1, PrintNotebookText
+ db $ff
+
CeladonPokecenterHiddenObjects:
- db $04,$00,$08
- db Bank(PrintBenchGuyText)
- dw PrintBenchGuyText
- db $03,$0d,$04
- db BANK(OpenPokemonCenterPC)
- dw OpenPokemonCenterPC
- db $FF
+ hidden_object 4, 0, SPRITE_FACING_LEFT, PrintBenchGuyText
+ hidden_object 3, 13, SPRITE_FACING_UP, OpenPokemonCenterPC
+ db $ff
+
CeladonGymHiddenObjects:
- db $0f,$03,$04
- dbw BANK(GymStatues),GymStatues
- db $0f,$06,$04
- dbw BANK(GymStatues),GymStatues
- db $FF
+ hidden_object 15, 3, SPRITE_FACING_UP, GymStatues
+ hidden_object 15, 6, SPRITE_FACING_UP, GymStatues
+ db $ff
+
GameCornerHiddenObjects:
- db $0f,$12,$d0
- dbw BANK(StartSlotMachine), StartSlotMachine
- db $0e,$12,$d0
- dbw BANK(StartSlotMachine), StartSlotMachine
- db $0d,$12,$d0
- dbw BANK(StartSlotMachine), StartSlotMachine
- db $0c,$12,$d0
- dbw BANK(StartSlotMachine), StartSlotMachine
- db $0b,$12,$d0
- dbw BANK(StartSlotMachine), StartSlotMachine
- db $0a,$12,$ff ; "Someone's Keys"
- dbw BANK(StartSlotMachine), StartSlotMachine
- db $0a,$0d,$d0
- dbw BANK(StartSlotMachine), StartSlotMachine
- db $0b,$0d,$d0
- dbw BANK(StartSlotMachine), StartSlotMachine
- db $0c,$0d,$fe ; "Out To Lunch"
- dbw BANK(StartSlotMachine), StartSlotMachine
- db $0d,$0d,$d0
- dbw BANK(StartSlotMachine), StartSlotMachine
- db $0e,$0d,$d0
- dbw BANK(StartSlotMachine), StartSlotMachine
- db $0f,$0d,$d0
- dbw BANK(StartSlotMachine), StartSlotMachine
- db $0f,$0c,$d0
- dbw BANK(StartSlotMachine), StartSlotMachine
- db $0e,$0c,$d0
- dbw BANK(StartSlotMachine), StartSlotMachine
- db $0d,$0c,$d0
- dbw BANK(StartSlotMachine), StartSlotMachine
- db $0c,$0c,$d0
- dbw BANK(StartSlotMachine), StartSlotMachine
- db $0b,$0c,$d0
- dbw BANK(StartSlotMachine), StartSlotMachine
- db $0a,$0c,$d0
- dbw BANK(StartSlotMachine), StartSlotMachine
- db $0a,$07,$d0
- dbw BANK(StartSlotMachine), StartSlotMachine
- db $0b,$07,$d0
- dbw BANK(StartSlotMachine), StartSlotMachine
- db $0c,$07,$d0
- dbw BANK(StartSlotMachine), StartSlotMachine
- db $0d,$07,$d0
- dbw BANK(StartSlotMachine), StartSlotMachine
- db $0e,$07,$d0
- dbw BANK(StartSlotMachine), StartSlotMachine
- db $0f,$07,$d0
- dbw BANK(StartSlotMachine), StartSlotMachine
- db $0f,$06,$d0
- dbw BANK(StartSlotMachine), StartSlotMachine
- db $0e,$06,$d0
- dbw BANK(StartSlotMachine), StartSlotMachine
- db $0d,$06,$d0
- dbw BANK(StartSlotMachine), StartSlotMachine
- db $0c,$06,$fd ; "Out Of Order"
- dbw BANK(StartSlotMachine), StartSlotMachine
- db $0b,$06,$d0
- dbw BANK(StartSlotMachine), StartSlotMachine
- db $0a,$06,$d0
- dbw BANK(StartSlotMachine), StartSlotMachine
- db $0a,$01,$d0
- dbw BANK(StartSlotMachine), StartSlotMachine
- db $0b,$01,$d0
- dbw BANK(StartSlotMachine), StartSlotMachine
- db $0c,$01,$d0
- dbw BANK(StartSlotMachine), StartSlotMachine
- db $0d,$01,$d0
- dbw BANK(StartSlotMachine), StartSlotMachine
- db $0e,$01,$d0
- dbw BANK(StartSlotMachine), StartSlotMachine
- db $0f,$01,$d0
- dbw BANK(StartSlotMachine), StartSlotMachine
- db $08,$00,COIN+10
- dbw BANK(HiddenCoins),HiddenCoins
- db $10,$01,COIN+10
- dbw BANK(HiddenCoins),HiddenCoins
- db $0b,$03,COIN+20
- dbw BANK(HiddenCoins),HiddenCoins
- db $0e,$03,COIN+10
- dbw BANK(HiddenCoins),HiddenCoins
- db $0c,$04,COIN+10
- dbw BANK(HiddenCoins),HiddenCoins
- db $0c,$09,COIN+20
- dbw BANK(HiddenCoins),HiddenCoins
- db $0f,$09,COIN+10
- dbw BANK(HiddenCoins),HiddenCoins
- db $0e,$10,COIN+10
- dbw BANK(HiddenCoins),HiddenCoins
- db $10,$0a,COIN+10
- dbw BANK(HiddenCoins),HiddenCoins
- db $07,$0b,COIN+40
- dbw BANK(HiddenCoins),HiddenCoins
- db $08,$0f,COIN+100
- dbw BANK(HiddenCoins),HiddenCoins
- db $0f,$0c,COIN+10
- dbw BANK(HiddenCoins),HiddenCoins
- db $FF
-CeladonHotelHiddenObjects:
- db $03,$0d,$04
- db BANK(OpenPokemonCenterPC)
- dw OpenPokemonCenterPC
- db $04,$00,$08
- db Bank(PrintBenchGuyText)
- dw PrintBenchGuyText
- db $FF
+ hidden_object 15, 18, $d0, StartSlotMachine
+ hidden_object 14, 18, $d0, StartSlotMachine
+ hidden_object 13, 18, $d0, StartSlotMachine
+ hidden_object 12, 18, $d0, StartSlotMachine
+ hidden_object 11, 18, $d0, StartSlotMachine
+ hidden_object 10, 18, $ff, StartSlotMachine ; "Someone's Keys"
+ hidden_object 10, 13, $d0, StartSlotMachine
+ hidden_object 11, 13, $d0, StartSlotMachine
+ hidden_object 12, 13, $fe, StartSlotMachine ; "Out To Lunch"
+ hidden_object 13, 13, $d0, StartSlotMachine
+ hidden_object 14, 13, $d0, StartSlotMachine
+ hidden_object 15, 13, $d0, StartSlotMachine
+ hidden_object 15, 12, $d0, StartSlotMachine
+ hidden_object 14, 12, $d0, StartSlotMachine
+ hidden_object 13, 12, $d0, StartSlotMachine
+ hidden_object 12, 12, $d0, StartSlotMachine
+ hidden_object 11, 12, $d0, StartSlotMachine
+ hidden_object 10, 12, $d0, StartSlotMachine
+ hidden_object 10, 7, $d0, StartSlotMachine
+ hidden_object 11, 7, $d0, StartSlotMachine
+ hidden_object 12, 7, $d0, StartSlotMachine
+ hidden_object 13, 7, $d0, StartSlotMachine
+ hidden_object 14, 7, $d0, StartSlotMachine
+ hidden_object 15, 7, $d0, StartSlotMachine
+ hidden_object 15, 6, $d0, StartSlotMachine
+ hidden_object 14, 6, $d0, StartSlotMachine
+ hidden_object 13, 6, $d0, StartSlotMachine
+ hidden_object 12, 6, $fd, StartSlotMachine ; "Out Of Order"
+ hidden_object 11, 6, $d0, StartSlotMachine
+ hidden_object 10, 6, $d0, StartSlotMachine
+ hidden_object 10, 1, $d0, StartSlotMachine
+ hidden_object 11, 1, $d0, StartSlotMachine
+ hidden_object 12, 1, $d0, StartSlotMachine
+ hidden_object 13, 1, $d0, StartSlotMachine
+ hidden_object 14, 1, $d0, StartSlotMachine
+ hidden_object 15, 1, $d0, StartSlotMachine
+ hidden_object 8, 0, COIN + 10, HiddenCoins
+ hidden_object 16, 1, COIN + 10, HiddenCoins
+ hidden_object 11, 3, COIN + 20, HiddenCoins
+ hidden_object 14, 3, COIN + 10, HiddenCoins
+ hidden_object 12, 4, COIN + 10, HiddenCoins
+ hidden_object 12, 9, COIN + 20, HiddenCoins
+ hidden_object 15, 9, COIN + 10, HiddenCoins
+ hidden_object 14, 16, COIN + 10, HiddenCoins
+ hidden_object 16, 10, COIN + 10, HiddenCoins
+ hidden_object 7, 11, COIN + 40, HiddenCoins
+ hidden_object 8, 15, COIN + 100, HiddenCoins
+ hidden_object 15, 12, COIN + 10, HiddenCoins
+ db $ff
+
FuchsiaPokecenterHiddenObjects:
- db $03,$0d,$04
- db BANK(OpenPokemonCenterPC)
- dw OpenPokemonCenterPC
- db $04,$00,$04
- db Bank(PrintBenchGuyText)
- dw PrintBenchGuyText
- db $FF
-FuchsiaGymHiddenObjects:
- db $0f,$03,$04
- dbw BANK(GymStatues),GymStatues
- db $0f,$06,$04
- dbw BANK(GymStatues),GymStatues
- db $FF
-CinnabarGymHiddenObjects:
- db $0d,$11,$04
- dbw BANK(GymStatues),GymStatues
- db $07,$0f,$01
- db Bank(PrintCinnabarQuiz)
- dw PrintCinnabarQuiz
- db $01,$0a,$12
- db Bank(PrintCinnabarQuiz)
- dw PrintCinnabarQuiz
- db $07,$09,$13
- db Bank(PrintCinnabarQuiz)
- dw PrintCinnabarQuiz
- db $0d,$09,$14
- db Bank(PrintCinnabarQuiz)
- dw PrintCinnabarQuiz
- db $0d,$01,$05
- db Bank(PrintCinnabarQuiz)
- dw PrintCinnabarQuiz
- db $07,$01,$16
- db Bank(PrintCinnabarQuiz)
- dw PrintCinnabarQuiz
- db $FF
-CinnabarPokecenterHiddenObjects:
- db $04,$00,$04
- db Bank(PrintBenchGuyText)
- dw PrintBenchGuyText
- db $03,$0d,$04
- db BANK(OpenPokemonCenterPC)
- dw OpenPokemonCenterPC
- db $FF
-SaffronGymHiddenObjects:
- db $0f,$09,$04
- dbw BANK(GymStatues),GymStatues
- db $FF
-MtMoonPokecenterHiddenObjects:
- db $04,$00,$08
- db Bank(PrintBenchGuyText)
- dw PrintBenchGuyText
- db $03,$0d,$04
- db BANK(OpenPokemonCenterPC)
- dw OpenPokemonCenterPC
- db $FF
-RockTunnelPokecenterHiddenObjects:
- db $04,$00,$08
- db Bank(PrintBenchGuyText)
- dw PrintBenchGuyText
- db $03,$0d,$04
- db BANK(OpenPokemonCenterPC)
- dw OpenPokemonCenterPC
- db $FF
-ViridianForestHiddenObjects:
- db $12,$01,POTION
- dbw BANK(HiddenItems),HiddenItems
- db $2a,$10,ANTIDOTE
- dbw BANK(HiddenItems),HiddenItems
- db $FF
-MtMoon3HiddenObjects:
- db $0c,$12,MOON_STONE
- dbw BANK(HiddenItems),HiddenItems
- db $09,$21,ETHER
- dbw BANK(HiddenItems),HiddenItems
- db $FF
-IndigoPlateauHiddenObjects:
- db $0d,$08,$ff
- db BANK(PrintIndigoPlateauHQText)
- dw PrintIndigoPlateauHQText
- db $0d,$0b,$00
- db BANK(PrintIndigoPlateauHQText)
- dw PrintIndigoPlateauHQText
- db $FF
-Route25HiddenObjects:
- db $03,$26,ETHER
- dbw BANK(HiddenItems),HiddenItems
- db $01,$0a,ELIXER
- dbw BANK(HiddenItems),HiddenItems
- db $FF
-Route9HiddenObjects:
- db $07,$0e,ETHER
- dbw BANK(HiddenItems),HiddenItems
- db $FF
-SSAnne6HiddenObjects:
- db $05,$0d,$00
- dbw BANK(PrintTrashText), PrintTrashText
- db $07,$0d,$00
- dbw BANK(PrintTrashText), PrintTrashText
- db $09,$0d,GREAT_BALL
- dbw BANK(HiddenItems),HiddenItems
- db $FF
-SSAnne10HiddenObjects:
- db $01,$03,HYPER_POTION
- dbw BANK(HiddenItems),HiddenItems
- db $FF
-Route10HiddenObjects:
- db $11,$09,SUPER_POTION
- dbw BANK(HiddenItems),HiddenItems
- db $35,$10,MAX_ETHER
- dbw BANK(HiddenItems),HiddenItems
- db $FF
-RocketHideout1HiddenObjects:
- db $0f,$15,PP_UP
- dbw BANK(HiddenItems),HiddenItems
- db $FF
-RocketHideout3HiddenObjects:
- db $11,$1b,NUGGET
- dbw BANK(HiddenItems),HiddenItems
- db $FF
-RocketHideout4HiddenObjects:
- db $01,$19,SUPER_POTION
- dbw BANK(HiddenItems),HiddenItems
- db $FF
-SaffronPokecenterHiddenObjects:
- db $04,$00,$04
- db Bank(PrintBenchGuyText)
- dw PrintBenchGuyText
- db $03,$0d,$04
- db BANK(OpenPokemonCenterPC)
- dw OpenPokemonCenterPC
- db $FF
-PokemonTower5HiddenObjects:
- db $0c,$04,ELIXER
- dbw BANK(HiddenItems),HiddenItems
- db $FF
-Route13HiddenObjects:
- db $0e,$01,PP_UP
- dbw BANK(HiddenItems),HiddenItems
- db $0d,$10,CALCIUM
- dbw BANK(HiddenItems),HiddenItems
- db $FF
+ hidden_object 3, 13, SPRITE_FACING_UP, OpenPokemonCenterPC
+ hidden_object 4, 0, SPRITE_FACING_UP, PrintBenchGuyText
+ db $ff
+
SafariZoneEntranceHiddenObjects:
- db $01,$0a,NUGGET
- dbw BANK(HiddenItems),HiddenItems
- db $FF
-SafariZoneWestHiddenObjects:
- db $05,$06,REVIVE
- dbw BANK(HiddenItems),HiddenItems
- db $FF
-SilphCo5FHiddenObjects:
- db $03,$0c,ELIXER
- dbw BANK(HiddenItems),HiddenItems
- db $FF
-SilphCo9FHiddenObjects:
- db $0f,$02,MAX_POTION
- dbw BANK(HiddenItems),HiddenItems
- db $FF
-CopycatsHouse2FHiddenObjects:
- db $01,$01,NUGGET
- dbw BANK(HiddenItems),HiddenItems
- db $FF
-CeruleanCave1HiddenObjects:
- db $0b,$0e,RARE_CANDY
- dbw BANK(HiddenItems),HiddenItems
- db $FF
-CeruleanCave3HiddenObjects:
- db $03,$1b,ULTRA_BALL
- dbw BANK(HiddenItems),HiddenItems
- db $FF
-PowerPlantHiddenObjects:
- db $10,$11,MAX_ELIXER
- dbw BANK(HiddenItems),HiddenItems
- db $01,$0c,PP_UP
- dbw BANK(HiddenItems),HiddenItems
- db $FF
-SeafoamIslands3HiddenObjects:
- db $0f,$0f,NUGGET
- dbw BANK(HiddenItems),HiddenItems
- db $FF
-SeafoamIslands5HiddenObjects:
- db $11,$19,ULTRA_BALL
- dbw BANK(HiddenItems),HiddenItems
- db $FF
+ hidden_object 1, 10, NUGGET, HiddenItems
+ db $ff
+
+FuchsiaGymHiddenObjects:
+ hidden_object 15, 3, SPRITE_FACING_UP, GymStatues
+ hidden_object 15, 6, SPRITE_FACING_UP, GymStatues
+ db $ff
+
Mansion1HiddenObjects:
- db $10,$08,MOON_STONE
- dbw BANK(HiddenItems),HiddenItems
- db $05,$02,$04
- db BANK(Mansion1Script_Switches)
- dw Mansion1Script_Switches
- db $FF
-Mansion2HiddenObjects:
- db $0b,$02,$04
- db BANK(Mansion2Script_Switches)
- dw Mansion2Script_Switches
- db $FF
-Mansion3HiddenObjects:
- db $09,$01,MAX_REVIVE
- dbw BANK(HiddenItems),HiddenItems
- db $05,$0a,$04
- db BANK(Mansion3Script_Switches)
- dw Mansion3Script_Switches
- db $FF
-Mansion4HiddenObjects:
- db $09,$01,RARE_CANDY
- dbw BANK(HiddenItems),HiddenItems
- db $03,$14,$04
- db BANK(Mansion4Script_Switches)
- dw Mansion4Script_Switches
- db $19,$12,$04
- db BANK(Mansion4Script_Switches)
- dw Mansion4Script_Switches
- db $FF
-Route23HiddenObjects:
- db $2c,$09,FULL_RESTORE
- dbw BANK(HiddenItems),HiddenItems
- db $46,$13,ULTRA_BALL
- dbw BANK(HiddenItems),HiddenItems
- db $5a,$08,MAX_ETHER
- dbw BANK(HiddenItems),HiddenItems
- db $FF
-VictoryRoad2HiddenObjects:
- db $02,$05,ULTRA_BALL
- dbw BANK(HiddenItems),HiddenItems
- db $07,$1a,FULL_RESTORE
- dbw BANK(HiddenItems),HiddenItems
- db $FF
-Unused6FHiddenObjects:
- db $0b,$0e,MAX_ELIXER
- dbw BANK(HiddenItems),HiddenItems
- db $FF
-BillsHouseHiddenObjects:
- db $04,$01,$04
- dbw BANK(BillsHousePC), BillsHousePC
- db $FF
-ViridianCityHiddenObjects:
- db $04,$0e,POTION
- dbw BANK(HiddenItems),HiddenItems
- db $FF
-SafariZoneRestHouse2HiddenObjects:
- db $04,$00,$08
- db Bank(PrintBenchGuyText)
- dw PrintBenchGuyText
- db $03,$0d,$04
- db BANK(OpenPokemonCenterPC)
- dw OpenPokemonCenterPC
- db $FF
-SafariZoneRestHouse3HiddenObjects:
- db $04,$00,$08
- db Bank(PrintBenchGuyText)
- dw PrintBenchGuyText
- db $03,$0d,$04
- db BANK(OpenPokemonCenterPC)
- dw OpenPokemonCenterPC
- db $FF
-SafariZoneRestHouse4HiddenObjects:
- db $04,$00,$08
- db Bank(PrintBenchGuyText)
- dw PrintBenchGuyText
- db $03,$0d,$04
- db BANK(OpenPokemonCenterPC)
- dw OpenPokemonCenterPC
- db $FF
-Route15GateUpstairsHiddenObjects:
- db $02,$01,$04
- db BANK(Route15GateLeftBinoculars)
- dw Route15GateLeftBinoculars
- db $FF
-LavenderHouse1HiddenObjects:
- db $01,$00,$00
- db BANK(PrintMagazinesText)
- dw PrintMagazinesText
- db $01,$01,$00
- db BANK(PrintMagazinesText)
- dw PrintMagazinesText
- db $01,$07,$00
- db BANK(PrintMagazinesText)
- dw PrintMagazinesText
- db $FF
-CeladonMansion5HiddenObjects:
- db $00,$03,(LinkCableHelp_id - TextPredefs) / 2 + 1
- db BANK(PrintBlackboardLinkCableText)
- dw PrintBlackboardLinkCableText
- db $00,$04,(LinkCableHelp_id - TextPredefs) / 2 + 1
- db BANK(PrintBlackboardLinkCableText)
- dw PrintBlackboardLinkCableText
- db $04,$03,(TMNotebook_id - TextPredefs) / 2 + 1
- db Bank(PrintNotebookText)
- dw PrintNotebookText
- db $FF
-FightingDojoHiddenObjects:
- db $09,$03,$04
- db BANK(PrintFightingDojoText)
- dw PrintFightingDojoText
- db $09,$06,$04
- db BANK(PrintFightingDojoText)
- dw PrintFightingDojoText
- db $00,$04,$04
- db BANK(PrintFightingDojoText2)
- dw PrintFightingDojoText2
- db $00,$05,$04
- db BANK(PrintFightingDojoText3)
- dw PrintFightingDojoText3
- db $FF
-IndigoPlateauLobbyHiddenObjects:
- db $07,$0f,$04
- db BANK(OpenPokemonCenterPC)
- dw OpenPokemonCenterPC
- db $FF
+ hidden_object 16, 8, MOON_STONE, HiddenItems
+ hidden_object 5, 2, SPRITE_FACING_UP, Mansion1Script_Switches
+ db $ff
+
+CinnabarGymHiddenObjects:
+ hidden_object 13, 17, SPRITE_FACING_UP, GymStatues
+ hidden_object 7, 15, (0 << 4) | 1, PrintCinnabarQuiz
+ hidden_object 1, 10, (1 << 4) | 2, PrintCinnabarQuiz
+ hidden_object 7, 9, (1 << 4) | 3, PrintCinnabarQuiz
+ hidden_object 13, 9, (1 << 4) | 4, PrintCinnabarQuiz
+ hidden_object 13, 1, (0 << 4) | 5, PrintCinnabarQuiz
+ hidden_object 7, 1, (1 << 4) | 6, PrintCinnabarQuiz
+ db $ff
+
CinnabarLab4HiddenObjects:
- db $04,$00,$04
- db BANK(OpenPokemonCenterPC)
- dw OpenPokemonCenterPC
- db $04,$02,$04
- db BANK(OpenPokemonCenterPC)
- dw OpenPokemonCenterPC
- db $FF
-BikeShopHiddenObjects:
- db $00,$01,$d0
- dbw BANK(PrintNewBikeText), PrintNewBikeText
- db $01,$02,$d0
- dbw BANK(PrintNewBikeText), PrintNewBikeText
- db $02,$01,$d0
- dbw BANK(PrintNewBikeText), PrintNewBikeText
- db $02,$03,$d0
- dbw BANK(PrintNewBikeText), PrintNewBikeText
- db $04,$00,$d0
- dbw BANK(PrintNewBikeText), PrintNewBikeText
- db $05,$01,$d0
- dbw BANK(PrintNewBikeText), PrintNewBikeText
- db $FF
-Route11HiddenObjects:
- db $05,$30,ESCAPE_ROPE
- dbw BANK(HiddenItems),HiddenItems
- db $FF
-Route12HiddenObjects:
- db $3f,$02,HYPER_POTION
- dbw BANK(HiddenItems),HiddenItems
- db $FF
-SilphCo11FHiddenObjects:
- db $0c,$0a,$04
- db BANK(OpenPokemonCenterPC)
- dw OpenPokemonCenterPC
- db $FF
-Route17HiddenObjects:
- db $0e,$0f,RARE_CANDY
- dbw BANK(HiddenItems),HiddenItems
- db $2d,$08,FULL_RESTORE
- dbw BANK(HiddenItems),HiddenItems
- db $48,$11,PP_UP
- dbw BANK(HiddenItems),HiddenItems
- db $5b,$04,MAX_REVIVE
- dbw BANK(HiddenItems),HiddenItems
- db $79,$08,MAX_ELIXER
- dbw BANK(HiddenItems),HiddenItems
- db $FF
-UndergroundPathNsHiddenObjects:
- db $04,$03,FULL_RESTORE
- dbw BANK(HiddenItems),HiddenItems
- db $22,$04,X_SPECIAL
- dbw BANK(HiddenItems),HiddenItems
- db $FF
-UndergroundPathWeHiddenObjects:
- db $02,$0c,NUGGET
- dbw BANK(HiddenItems),HiddenItems
- db $05,$15,ELIXER
- dbw BANK(HiddenItems),HiddenItems
- db $FF
-CeladonCityHiddenObjects:
- db $0f,$30,PP_UP
- dbw BANK(HiddenItems),HiddenItems
- db $FF
-SeafoamIslands4HiddenObjects:
- db $10,$09,MAX_ELIXER
- dbw BANK(HiddenItems),HiddenItems
- db $FF
-VermilionCityHiddenObjects:
- db $0b,$0e,MAX_ETHER
- dbw BANK(HiddenItems),HiddenItems
- db $FF
-CeruleanCityHiddenObjects:
- db $08,$0f,RARE_CANDY
- dbw BANK(HiddenItems),HiddenItems
- db $FF
-Route4HiddenObjects:
- db $03,$28,GREAT_BALL
- dbw BANK(HiddenItems),HiddenItems
- db $FF
+ hidden_object 4, 0, SPRITE_FACING_UP, OpenPokemonCenterPC
+ hidden_object 4, 2, SPRITE_FACING_UP, OpenPokemonCenterPC
+ db $ff
+
+CinnabarPokecenterHiddenObjects:
+ hidden_object 4, 0, SPRITE_FACING_UP, PrintBenchGuyText
+ hidden_object 3, 13, SPRITE_FACING_UP, OpenPokemonCenterPC
+ db $ff
diff --git a/data/hide_show_data.asm b/data/hide_show_data.asm
index 7f4593ca..df9e5e8f 100755
--- a/data/hide_show_data.asm
+++ b/data/hide_show_data.asm
@@ -68,7 +68,7 @@ MapHSPointers:
dw MapHSXX
dw MapHS3D
dw MapHSXX
- dw MapHSXX
+ dw MapHS3F
dw MapHSXX
dw MapHSXX
dw MapHSXX
@@ -253,6 +253,7 @@ MapHSPointers:
dw MapHSXX
dw MapHSXX
dw MapHSXX
+ dw MapHSXX ; beach house
dw $FFFF
; Structure:
@@ -266,8 +267,8 @@ MapHSPointers:
; This Data is loaded into RAM at wd5ce-$D5F?. (wMissableObjectList)
; These constants come from the bytes for Predef functions:
-Hide equ $11
-Show equ $15
+Hide EQU $11 ; (HideObjectPredef - PredefPointers) / 3
+Show EQU $15 ; (ShowObjectPredef - PredefPointers) / 3
MapHSXX:
db $FF,$FF,$FF
@@ -276,6 +277,7 @@ MapHS00:
MapHS01:
db VIRIDIAN_CITY,$05,Show
db VIRIDIAN_CITY,$07,Hide
+ db VIRIDIAN_CITY,$08,Hide
MapHS02:
db PEWTER_CITY,$03,Show
db PEWTER_CITY,$05,Show
@@ -331,21 +333,22 @@ MapHS27:
MapHS28:
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
MapHS2D:
db VIRIDIAN_GYM,$01,Show
db VIRIDIAN_GYM,$0B,Show
MapHS34:
db MUSEUM_1F,$05,Show
+MapHS3F: ; bulbasaur adoption house
+ db CERULEAN_TRADE_HOUSE,$02,Show
MapHSE4:
db CERULEAN_CAVE_1F,$01,Show
db CERULEAN_CAVE_1F,$02,Show
db CERULEAN_CAVE_1F,$03,Show
+ db CERULEAN_CAVE_1F,$04,Show
MapHS8F:
db POKEMON_TOWER_2F,$01,Show
MapHS90:
@@ -360,10 +363,9 @@ MapHS93:
db POKEMON_TOWER_6F,$04,Show
db POKEMON_TOWER_6F,$05,Show
MapHS94:
- 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
MapHS95:
db MR_FUJIS_HOUSE,$05,Hide
MapHS84:
@@ -407,9 +409,9 @@ MapHS58:
db BILLS_HOUSE,$02,Hide
db BILLS_HOUSE,$03,Hide
MapHS33:
- 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
MapHS3B:
db MT_MOON_1F,$08,Show
db MT_MOON_1F,$09,Show
@@ -418,10 +420,12 @@ MapHS3B:
db MT_MOON_1F,$0C,Show
db MT_MOON_1F,$0D,Show
MapHS3D:
- 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
MapHS60:
db SS_ANNE_2F,$02,Hide
MapHS66:
@@ -450,6 +454,8 @@ MapHSC9:
db ROCKET_HIDEOUT_B3F,$04,Show
MapHSCA:
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
@@ -514,6 +520,7 @@ MapHSEB:
db SILPH_CO_11F,$03,Show
db SILPH_CO_11F,$04,Show
db SILPH_CO_11F,$05,Show
+ db SILPH_CO_11F,$06,Show
MapHSF4:
db UNUSED_MAP_F4,$02,Show
MapHSD6:
@@ -546,10 +553,13 @@ MapHSE2:
db CERULEAN_CAVE_2F,$01,Show
db CERULEAN_CAVE_2F,$02,Show
db CERULEAN_CAVE_2F,$03,Show
+ db CERULEAN_CAVE_2F,$04,Show
MapHSE3:
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
MapHS6C:
db VICTORY_ROAD_1F,$03,Show
db VICTORY_ROAD_1F,$04,Show
@@ -574,4 +584,10 @@ MapHSA2:
db SEAFOAM_ISLANDS_B4F,$02,Hide
db SEAFOAM_ISLANDS_B4F,$03,Show
+MapHS27Copy:
+; doesn't seem to be referenced
+ db BLUES_HOUSE,$01,Show
+ db BLUES_HOUSE,$02,Hide
+ db BLUES_HOUSE,$03,Show
+
db $FF,$01,Show
diff --git a/data/mapHeaders/BeachHouse.asm b/data/mapHeaders/BeachHouse.asm
new file mode 100644
index 00000000..b1b69e5a
--- /dev/null
+++ b/data/mapHeaders/BeachHouse.asm
@@ -0,0 +1,8 @@
+BeachHouse_h:
+ db BEACH_HOUSE_TILESET
+ db BEACH_HOUSE_HEIGHT, BEACH_HOUSE_WIDTH ; dimensions (y, x)
+ dw BeachHouse_Blocks ; blocks
+ dw BeachHouse_TextPointers ; texts
+ dw BeachHouse_Script ; scripts
+ db 0 ; connections
+ dw BeachHouse_Object ; objects
diff --git a/data/mapObjects/BeachHouse.asm b/data/mapObjects/BeachHouse.asm
new file mode 100644
index 00000000..02bd8037
--- /dev/null
+++ b/data/mapObjects/BeachHouse.asm
@@ -0,0 +1,20 @@
+BeachHouse_Object:
+ db $a ; border block
+
+ db 2 ; warps
+ warp 2,7,0,-1
+ warp 3,7,0,-1
+
+ db 4 ; signs
+ sign 3,0,3
+ sign 7,0,4
+ sign 11,0,5
+ sign 13,1,6
+
+ db 2 ; objects
+ object SPRITE_FISHER, 2, 3, STAY, DOWN, 1 ; surfin' dude
+ object $3d, 5, 3, WALK, $01, 2 ; pikachu
+
+ ; warp-to
+ warp_to 2,7, BEACH_HOUSE_WIDTH
+ warp_to 3,7, BEACH_HOUSE_WIDTH
diff --git a/data/mapObjects/BluesHouse.asm b/data/mapObjects/BluesHouse.asm
index 45ca1286..24c5baab 100755
--- a/data/mapObjects/BluesHouse.asm
+++ b/data/mapObjects/BluesHouse.asm
@@ -8,7 +8,7 @@ BluesHouse_Object:
db 0 ; signs
db 3 ; 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, 1, 2, 0 ; Daisy, walking around
object SPRITE_BOOK_MAP_DEX, 3, 3, STAY, NONE, 3, 0 ; map on table
diff --git a/data/mapObjects/CeladonMart3F.asm b/data/mapObjects/CeladonMart3F.asm
index 6dfce535..6c6adfd4 100755
--- a/data/mapObjects/CeladonMart3F.asm
+++ b/data/mapObjects/CeladonMart3F.asm
@@ -22,9 +22,9 @@ CeladonMart3F_Object:
db 5 ; objects
object SPRITE_MART_GUY, 16, 5, STAY, NONE, 1 ; person
- object SPRITE_GAMEBOY_KID_COPY, 11, 6, STAY, RIGHT, 2 ; person
- object SPRITE_GAMEBOY_KID_COPY, 7, 2, STAY, DOWN, 3 ; person
- object SPRITE_GAMEBOY_KID_COPY, 8, 2, STAY, DOWN, 4 ; person
+ object SPRITE_GAMEBOY_KID, 11, 6, STAY, RIGHT, 2 ; person
+ object SPRITE_GAMEBOY_KID, 7, 2, STAY, DOWN, 3 ; person
+ object SPRITE_GAMEBOY_KID, 8, 2, STAY, DOWN, 4 ; person
object SPRITE_YOUNG_BOY, 2, 5, STAY, UP, 5 ; person
; warp-to
diff --git a/data/mapObjects/CeladonPokecenter.asm b/data/mapObjects/CeladonPokecenter.asm
index da5d595f..91698e34 100755
--- a/data/mapObjects/CeladonPokecenter.asm
+++ b/data/mapObjects/CeladonPokecenter.asm
@@ -7,11 +7,12 @@ CeladonPokecenter_Object:
db 0 ; signs
- db 4 ; objects
+ db 5 ; objects
object SPRITE_NURSE, 3, 1, STAY, DOWN, 1 ; person
- object SPRITE_GENTLEMAN, 7, 3, WALK, 2, 2 ; person
+ object SPRITE_GENTLEMAN, 7, 3, STAY, DOWN, 2 ; person
object SPRITE_FOULARD_WOMAN, 10, 5, WALK, 0, 3 ; person
object SPRITE_CABLE_CLUB_WOMAN, 11, 2, STAY, DOWN, 4 ; person
+ object SPRITE_CHANSEY, 4, 1, STAY, DOWN, 5 ; person
; warp-to
warp_to 3, 7, CELADON_POKECENTER_WIDTH
diff --git a/data/mapObjects/CeruleanCave1F.asm b/data/mapObjects/CeruleanCave1F.asm
index f9670482..a7f72b34 100755
--- a/data/mapObjects/CeruleanCave1F.asm
+++ b/data/mapObjects/CeruleanCave1F.asm
@@ -14,10 +14,11 @@ CeruleanCave1F_Object:
db 0 ; signs
- db 3 ; objects
- object SPRITE_BALL, 7, 13, STAY, NONE, 1, FULL_RESTORE
- object SPRITE_BALL, 19, 3, STAY, NONE, 2, MAX_ELIXER
- object SPRITE_BALL, 5, 0, STAY, NONE, 3, NUGGET
+ db 4 ; objects
+ object SPRITE_BALL, $1d, $10, STAY, NONE, $1, RARE_CANDY
+ object SPRITE_BALL, $7, $b, STAY, NONE, $2, MAX_ELIXER
+ object SPRITE_BALL, $1d, $9, STAY, NONE, $3, MAX_REVIVE
+ object SPRITE_BALL, $12, $3, STAY, NONE, $4, ULTRA_BALL
; warp-to
warp_to 24, 17, CERULEAN_CAVE_1F_WIDTH
diff --git a/data/mapObjects/CeruleanCave2F.asm b/data/mapObjects/CeruleanCave2F.asm
index f8312da0..9a15eef8 100755
--- a/data/mapObjects/CeruleanCave2F.asm
+++ b/data/mapObjects/CeruleanCave2F.asm
@@ -11,10 +11,11 @@ CeruleanCave2F_Object:
db 0 ; signs
- db 3 ; objects
- object SPRITE_BALL, 29, 9, STAY, NONE, 1, PP_UP
- object SPRITE_BALL, 4, 15, STAY, NONE, 2, ULTRA_BALL
- object SPRITE_BALL, 13, 6, STAY, NONE, 3, FULL_RESTORE
+ db 4 ; objects
+ object SPRITE_BALL, 0, 11, STAY, NONE, 1, RARE_CANDY
+ object SPRITE_BALL, 16, 7, STAY, NONE, 2, ULTRA_BALL
+ object SPRITE_BALL, 19, 11, STAY, NONE, 3, MAX_REVIVE
+ object SPRITE_BALL, 27, 9, STAY, NONE, 4, FULL_RESTORE
; warp-to
warp_to 29, 1, CERULEAN_CAVE_2F_WIDTH ; CERULEAN_CAVE_1F
diff --git a/data/mapObjects/CeruleanCaveB1F.asm b/data/mapObjects/CeruleanCaveB1F.asm
index 461f77aa..193d674b 100755
--- a/data/mapObjects/CeruleanCaveB1F.asm
+++ b/data/mapObjects/CeruleanCaveB1F.asm
@@ -6,10 +6,12 @@ CeruleanCaveB1F_Object:
db 0 ; signs
- db 3 ; objects
+ db 5 ; objects
object SPRITE_SLOWBRO, 27, 13, STAY, DOWN, 1, MEWTWO, 70
- object SPRITE_BALL, 16, 9, STAY, NONE, 2, ULTRA_BALL
- object SPRITE_BALL, 18, 1, STAY, NONE, 3, MAX_REVIVE
+ object SPRITE_BALL, 26, 1, STAY, NONE, 2, ULTRA_BALL
+ object SPRITE_BALL, 2, 13, STAY, NONE, 3, ULTRA_BALL
+ object SPRITE_BALL, 3, 13, STAY, NONE, 4, MAX_REVIVE
+ object SPRITE_BALL, 15, 3, STAY, NONE, 5, MAX_ELIXER
; warp-to
warp_to 3, 6, CERULEAN_CAVE_B1F_WIDTH ; CERULEAN_CAVE_1F
diff --git a/data/mapObjects/CeruleanCity.asm b/data/mapObjects/CeruleanCity.asm
index d5adcfd7..ca05e65f 100755
--- a/data/mapObjects/CeruleanCity.asm
+++ b/data/mapObjects/CeruleanCity.asm
@@ -1,5 +1,5 @@
CeruleanCity_Object:
- db $f ; border block
+ db $a ; border block
db 10 ; warps
warp 27, 11, 0, CERULEAN_TRASHED_HOUSE
@@ -27,12 +27,12 @@ CeruleanCity_Object:
object SPRITE_BLACK_HAIR_BOY_1, 31, 20, STAY, DOWN, 3 ; person
object SPRITE_BLACK_HAIR_BOY_2, 15, 18, WALK, 1, 4 ; person
object SPRITE_BLACK_HAIR_BOY_2, 9, 21, WALK, 2, 5 ; person
- object SPRITE_GUARD, 28, 12, STAY, DOWN, 6 ; person
+ object SPRITE_OFFICER_JENNY, 28, 12, STAY, DOWN, 6 ; person
object SPRITE_LASS, 29, 26, STAY, LEFT, 7 ; person
- object SPRITE_SLOWBRO, 28, 26, STAY, DOWN, 8 ; person
+ object SPRITE_BALL, 28, 26, STAY, DOWN, 8 ; person
object SPRITE_LASS, 9, 27, WALK, 2, 9 ; person
object SPRITE_BLACK_HAIR_BOY_2, 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
; warp-to
warp_to 27, 11, CERULEAN_CITY_WIDTH ; CERULEAN_TRASHED_HOUSE
diff --git a/data/mapObjects/CeruleanPokecenter.asm b/data/mapObjects/CeruleanPokecenter.asm
index f65db52c..78b2330e 100755
--- a/data/mapObjects/CeruleanPokecenter.asm
+++ b/data/mapObjects/CeruleanPokecenter.asm
@@ -7,11 +7,12 @@ CeruleanPokecenter_Object:
db 0 ; signs
- db 4 ; objects
+ db 5 ; objects
object SPRITE_NURSE, 3, 1, STAY, DOWN, 1 ; person
object SPRITE_BLACK_HAIR_BOY_2, 10, 5, WALK, 0, 2 ; person
- object SPRITE_GENTLEMAN, 4, 3, STAY, DOWN, 3 ; person
+ object SPRITE_GENTLEMAN, 4, 3, STAY, UP, 3 ; person
object SPRITE_CABLE_CLUB_WOMAN, 11, 2, STAY, DOWN, 4 ; person
+ object SPRITE_CHANSEY, 4, 1, STAY, DOWN, 5 ; person
; warp-to
warp_to 3, 7, CERULEAN_POKECENTER_WIDTH
diff --git a/data/mapObjects/CeruleanTradeHouse.asm b/data/mapObjects/CeruleanTradeHouse.asm
index a4a46e9b..e51f9544 100755
--- a/data/mapObjects/CeruleanTradeHouse.asm
+++ b/data/mapObjects/CeruleanTradeHouse.asm
@@ -7,9 +7,11 @@ CeruleanTradeHouse_Object:
db 0 ; signs
- db 2 ; objects
- object SPRITE_OLD_MEDIUM_WOMAN, 5, 4, STAY, LEFT, 1 ; person
- object SPRITE_GAMBLER, 1, 2, STAY, NONE, 2 ; person
+ db 4 ; 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
; warp-to
warp_to 2, 7, CERULEAN_TRADE_HOUSE_WIDTH
diff --git a/data/mapObjects/CinnabarGym.asm b/data/mapObjects/CinnabarGym.asm
index ab204d43..1a6e96cd 100755
--- a/data/mapObjects/CinnabarGym.asm
+++ b/data/mapObjects/CinnabarGym.asm
@@ -8,7 +8,7 @@ CinnabarGym_Object:
db 0 ; signs
db 9 ; objects
- object SPRITE_FAT_BALD_GUY, 3, 3, STAY, DOWN, 1, OPP_BLAINE, 1
+ object SPRITE_MR_MASTERBALL, 3, 3, STAY, DOWN, 1, OPP_BLAINE, 1
object SPRITE_BLACK_HAIR_BOY_2, 17, 2, STAY, DOWN, 2, OPP_SUPER_NERD, 9
object SPRITE_BLACK_HAIR_BOY_2, 17, 8, STAY, DOWN, 3, OPP_BURGLAR, 4
object SPRITE_BLACK_HAIR_BOY_2, 11, 4, STAY, DOWN, 4, OPP_SUPER_NERD, 10
diff --git a/data/mapObjects/CinnabarPokecenter.asm b/data/mapObjects/CinnabarPokecenter.asm
index 9583ef2a..3c9efb34 100755
--- a/data/mapObjects/CinnabarPokecenter.asm
+++ b/data/mapObjects/CinnabarPokecenter.asm
@@ -7,11 +7,12 @@ CinnabarPokecenter_Object:
db 0 ; signs
- db 4 ; objects
+ db 5 ; objects
object SPRITE_NURSE, 3, 1, STAY, DOWN, 1 ; person
object SPRITE_LASS, 9, 4, WALK, 0, 2 ; person
object SPRITE_GENTLEMAN, 2, 6, STAY, NONE, 3 ; person
object SPRITE_CABLE_CLUB_WOMAN, 11, 2, STAY, DOWN, 4 ; person
+ object SPRITE_CHANSEY, 4, 1, STAY, DOWN, 5 ; person
; warp-to
warp_to 3, 7, CINNABAR_POKECENTER_WIDTH
diff --git a/data/mapObjects/Colosseum.asm b/data/mapObjects/Colosseum.asm
index 18762584..18762584 100755..100644
--- a/data/mapObjects/Colosseum.asm
+++ b/data/mapObjects/Colosseum.asm
diff --git a/data/mapObjects/CopycatsHouse1F.asm b/data/mapObjects/CopycatsHouse1F.asm
index cb4dbb0b..8bde12fe 100755
--- a/data/mapObjects/CopycatsHouse1F.asm
+++ b/data/mapObjects/CopycatsHouse1F.asm
@@ -11,7 +11,7 @@ CopycatsHouse1F_Object:
db 3 ; objects
object SPRITE_MOM_GEISHA, 2, 2, STAY, DOWN, 1 ; person
object SPRITE_FAT_BALD_GUY, 5, 4, STAY, LEFT, 2 ; person
- object SPRITE_CLEFAIRY, 1, 4, WALK, 1, 3 ; person
+ object SPRITE_CHANSEY, 1, 4, STAY, NONE, 3 ; person
; warp-to
warp_to 2, 7, COPYCATS_HOUSE_1F_WIDTH
diff --git a/data/mapObjects/FuchsiaCity.asm b/data/mapObjects/FuchsiaCity.asm
index 09c97b02..0368905c 100755
--- a/data/mapObjects/FuchsiaCity.asm
+++ b/data/mapObjects/FuchsiaCity.asm
@@ -33,7 +33,7 @@ FuchsiaCity_Object:
object SPRITE_GAMBLER, 28, 17, WALK, 2, 2 ; person
object SPRITE_FISHER2, 30, 14, STAY, DOWN, 3 ; person
object SPRITE_BUG_CATCHER, 24, 8, STAY, UP, 4 ; person
- object SPRITE_CLEFAIRY, 31, 5, WALK, 0, 5 ; person
+ object SPRITE_CHANSEY, 31, 5, STAY, DOWN, 5 ; person
object SPRITE_BALL, 25, 6, STAY, NONE, 6 ; person
object SPRITE_SLOWBRO, 12, 6, WALK, 2, 7 ; person
object SPRITE_SLOWBRO, 30, 12, WALK, 2, 8 ; person
diff --git a/data/mapObjects/FuchsiaGym.asm b/data/mapObjects/FuchsiaGym.asm
index 5d707d53..4e717086 100755
--- a/data/mapObjects/FuchsiaGym.asm
+++ b/data/mapObjects/FuchsiaGym.asm
@@ -8,7 +8,7 @@ FuchsiaGym_Object:
db 0 ; signs
db 8 ; objects
- object SPRITE_BLACKBELT, 4, 10, STAY, DOWN, 1, OPP_KOGA, 1
+ object SPRITE_LAPRAS_GIVER, 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/mapObjects/FuchsiaPokecenter.asm b/data/mapObjects/FuchsiaPokecenter.asm
index 73dc529d..b0056acd 100755
--- a/data/mapObjects/FuchsiaPokecenter.asm
+++ b/data/mapObjects/FuchsiaPokecenter.asm
@@ -7,11 +7,12 @@ FuchsiaPokecenter_Object:
db 0 ; signs
- db 4 ; objects
+ db 5 ; 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_LASS, 6, 5, WALK, 2, 3 ; person
object SPRITE_CABLE_CLUB_WOMAN, 11, 2, STAY, DOWN, 4 ; person
+ object SPRITE_CHANSEY, 4, 1, STAY, DOWN, 5 ; person
; warp-to
warp_to 3, 7, FUCHSIA_POKECENTER_WIDTH
diff --git a/data/mapObjects/GameCorner.asm b/data/mapObjects/GameCorner.asm
index 2704f6ab..afac025e 100755
--- a/data/mapObjects/GameCorner.asm
+++ b/data/mapObjects/GameCorner.asm
@@ -18,8 +18,8 @@ GameCorner_Object:
object SPRITE_MOM_GEISHA, 8, 11, STAY, LEFT, 6 ; person
object SPRITE_GYM_HELPER, 8, 14, STAY, LEFT, 7 ; person
object SPRITE_GAMBLER, 11, 15, STAY, RIGHT, 8 ; person
- object SPRITE_MART_GUY, 14, 11, STAY, LEFT, 9 ; person
- object SPRITE_GENTLEMAN, 17, 13, STAY, RIGHT, 10 ; person
+ object SPRITE_FAT_BALD_GUY, 14, 11, STAY, LEFT, 9 ; person
+ object SPRITE_FISHER, 17, 13, STAY, RIGHT, 10 ; person
object SPRITE_ROCKET, 9, 5, STAY, UP, 11, OPP_ROCKET, 7
; warp-to
diff --git a/data/mapObjects/IndigoPlateauLobby.asm b/data/mapObjects/IndigoPlateauLobby.asm
index ea113a16..d7de23a7 100755
--- a/data/mapObjects/IndigoPlateauLobby.asm
+++ b/data/mapObjects/IndigoPlateauLobby.asm
@@ -8,12 +8,13 @@ IndigoPlateauLobby_Object:
db 0 ; signs
- db 5 ; objects
+ db 6 ; objects
object SPRITE_NURSE, 7, 5, STAY, DOWN, 1 ; person
object SPRITE_GYM_HELPER, 4, 9, STAY, RIGHT, 2 ; person
object SPRITE_LASS, 5, 1, STAY, DOWN, 3 ; person
object SPRITE_MART_GUY, 0, 5, STAY, RIGHT, 4 ; person
object SPRITE_CABLE_CLUB_WOMAN, 13, 6, STAY, DOWN, 5 ; person
+ object SPRITE_CHANSEY, 8, 5, STAY, DOWN, 6 ; person
; warp-to
warp_to 7, 11, INDIGO_PLATEAU_LOBBY_WIDTH
diff --git a/data/mapObjects/LavenderPokecenter.asm b/data/mapObjects/LavenderPokecenter.asm
index 89e25571..6e38a8e9 100755
--- a/data/mapObjects/LavenderPokecenter.asm
+++ b/data/mapObjects/LavenderPokecenter.asm
@@ -7,11 +7,12 @@ LavenderPokecenter_Object:
db 0 ; signs
- db 4 ; objects
+ db 5 ; 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, 1, 3 ; person
+ object SPRITE_LITTLE_GIRL, 10, 5, WALK, 2, 3 ; person
object SPRITE_CABLE_CLUB_WOMAN, 11, 2, STAY, DOWN, 4 ; person
+ object SPRITE_CHANSEY, 4, 1, STAY, DOWN, 5 ; person
; warp-to
warp_to 3, 7, LAVENDER_POKECENTER_WIDTH
diff --git a/data/mapObjects/MtMoonB2F.asm b/data/mapObjects/MtMoonB2F.asm
index 27b2383f..a4c9869a 100755
--- a/data/mapObjects/MtMoonB2F.asm
+++ b/data/mapObjects/MtMoonB2F.asm
@@ -9,16 +9,17 @@ MtMoonB2F_Object:
db 0 ; signs
- db 9 ; objects
+ db 10 ; objects
object SPRITE_BLACK_HAIR_BOY_2, 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_OMANYTE, 12, 6, STAY, NONE, 6 ; person
- object SPRITE_OMANYTE, 13, 6, STAY, NONE, 7 ; person
- object SPRITE_BALL, 25, 21, STAY, NONE, 8, HP_UP
- object SPRITE_BALL, 29, 5, STAY, NONE, 9, TM_01
+ object SPRITE_ROCKET, 29, 17, STAY, LEFT, 5, OPP_ROCKET, 1
+ object SPRITE_JAMES, 9, 4, STAY, LEFT, 6
+ object SPRITE_OMANYTE, 12, 6, STAY, NONE, 7 ; person
+ object SPRITE_OMANYTE, 13, 6, STAY, NONE, 8 ; person
+ object SPRITE_BALL, 25, 21, STAY, NONE, 9, HP_UP
+ object SPRITE_BALL, 29, 5, STAY, NONE, 10, TM_01
; warp-to
warp_to 25, 9, MT_MOON_B2F_WIDTH ; MT_MOON_B1F
diff --git a/data/mapObjects/MtMoonPokecenter.asm b/data/mapObjects/MtMoonPokecenter.asm
index b23703e6..1027f88a 100755
--- a/data/mapObjects/MtMoonPokecenter.asm
+++ b/data/mapObjects/MtMoonPokecenter.asm
@@ -7,13 +7,14 @@ MtMoonPokecenter_Object:
db 0 ; signs
- db 6 ; objects
+ db 7 ; objects
object SPRITE_NURSE, 3, 1, STAY, DOWN, 1 ; person
object SPRITE_BUG_CATCHER, 4, 3, STAY, UP, 2 ; person
object SPRITE_GENTLEMAN, 7, 3, STAY, UP, 3 ; person
object SPRITE_FAT_BALD_GUY, 10, 6, WALK, 2, 4 ; person
object SPRITE_CLIPBOARD, 7, 2, STAY, NONE, 5 ; person
object SPRITE_CABLE_CLUB_WOMAN, 11, 2, STAY, DOWN, 6 ; person
+ object SPRITE_CHANSEY, 4, 1, STAY, DOWN, 7 ; person
; warp-to
warp_to 3, 7, MT_MOON_POKECENTER_WIDTH
diff --git a/data/mapObjects/OaksLab.asm b/data/mapObjects/OaksLab.asm
index fa78ccdf..cf48bec9 100755
--- a/data/mapObjects/OaksLab.asm
+++ b/data/mapObjects/OaksLab.asm
@@ -7,18 +7,16 @@ OaksLab_Object:
db 0 ; signs
- db 11 ; objects
+ db 9 ; objects
object SPRITE_BLUE, 4, 3, STAY, NONE, 1, OPP_SONY1, 1
- object SPRITE_BALL, 6, 3, STAY, NONE, 2 ; person
- object SPRITE_BALL, 7, 3, STAY, NONE, 3 ; person
- object SPRITE_BALL, 8, 3, STAY, NONE, 4 ; person
- object SPRITE_OAK, 5, 2, STAY, DOWN, 5 ; person
- object SPRITE_BOOK_MAP_DEX, 2, 1, STAY, NONE, 6 ; person
- object SPRITE_BOOK_MAP_DEX, 3, 1, STAY, NONE, 7 ; person
- object SPRITE_OAK, 5, 10, STAY, UP, 8 ; person
- object SPRITE_GIRL, 1, 9, WALK, 1, 9 ; person
- object SPRITE_OAK_AIDE, 2, 10, STAY, NONE, 10 ; person
- object SPRITE_OAK_AIDE, 8, 10, STAY, NONE, 11 ; person
+ object SPRITE_BALL, 7, 3, STAY, NONE, 2 ; person
+ object SPRITE_OAK, 5, 2, STAY, DOWN, 3 ; person
+ object SPRITE_BOOK_MAP_DEX, 2, 1, STAY, NONE, 4 ; person
+ object SPRITE_BOOK_MAP_DEX, 3, 1, STAY, NONE, 5 ; person
+ object SPRITE_OAK, 5, 10, STAY, UP, 6 ; person
+ object SPRITE_GIRL, 1, 9, WALK, 1, 7 ; person
+ object SPRITE_OAK_AIDE, 2, 10, STAY, NONE, 8 ; person
+ object SPRITE_OAK_AIDE, 8, 10, STAY, NONE, 9 ; person
; warp-to
warp_to 4, 11, OAKS_LAB_WIDTH
diff --git a/data/mapObjects/PalletTown.asm b/data/mapObjects/PalletTown.asm
index 68b01175..93807688 100755
--- a/data/mapObjects/PalletTown.asm
+++ b/data/mapObjects/PalletTown.asm
@@ -13,7 +13,7 @@ PalletTown_Object:
sign 11, 5, 7 ; PalletTownText7
db 3 ; 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, 0, 2 ; person
object SPRITE_FISHER2, 11, 14, WALK, 0, 3 ; person
diff --git a/data/mapObjects/PewterPokecenter.asm b/data/mapObjects/PewterPokecenter.asm
index 2b375bf9..4d460747 100755
--- a/data/mapObjects/PewterPokecenter.asm
+++ b/data/mapObjects/PewterPokecenter.asm
@@ -7,11 +7,13 @@ PewterPokecenter_Object:
db 0 ; signs
- db 4 ; objects
+ db 6 ; objects
object SPRITE_NURSE, 3, 1, STAY, DOWN, 1 ; person
object SPRITE_GENTLEMAN, 11, 7, STAY, LEFT, 2 ; person
- object SPRITE_CLEFAIRY, 1, 3, STAY, DOWN, 3 ; person
+ object SPRITE_JIGGLYPUFF, 1, 3, STAY, DOWN, 3 ; person
object SPRITE_CABLE_CLUB_WOMAN, 11, 2, STAY, DOWN, 4 ; person
+ object SPRITE_LASS, 4, 3, STAY, UP, 5 ; person
+ object SPRITE_CHANSEY, 4, 1, STAY, DOWN, 6 ; person
; warp-to
warp_to 3, 7, PEWTER_POKECENTER_WIDTH
diff --git a/data/mapObjects/PokemonFanClub.asm b/data/mapObjects/PokemonFanClub.asm
index e1f175f0..588ebdc2 100755
--- a/data/mapObjects/PokemonFanClub.asm
+++ b/data/mapObjects/PokemonFanClub.asm
@@ -5,14 +5,12 @@ PokemonFanClub_Object:
warp 2, 7, 1, -1
warp 3, 7, 1, -1
- db 2 ; signs
- sign 1, 0, 7 ; FanClubText7
- sign 6, 0, 8 ; FanClubText8
+ db 0 ; signs
db 6 ; objects
object SPRITE_FISHER2, 6, 3, STAY, LEFT, 1 ; person
object SPRITE_GIRL, 1, 3, STAY, RIGHT, 2 ; person
- object SPRITE_CLEFAIRY, 6, 4, STAY, LEFT, 3 ; person
+ object SPRITE_CLEFAIRY_2, 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_CABLE_CLUB_WOMAN, 5, 1, STAY, DOWN, 6 ; person
diff --git a/data/mapObjects/PokemonTower7F.asm b/data/mapObjects/PokemonTower7F.asm
index 79cb5b0d..ccd4f23c 100755
--- a/data/mapObjects/PokemonTower7F.asm
+++ b/data/mapObjects/PokemonTower7F.asm
@@ -6,11 +6,10 @@ PokemonTower7F_Object:
db 0 ; signs
- db 4 ; 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
+ db 3 ; objects
+ 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
; warp-to
warp_to 9, 16, POKEMON_TOWER_7F_WIDTH ; POKEMON_TOWER_6F
diff --git a/data/mapObjects/RockTunnelPokecenter.asm b/data/mapObjects/RockTunnelPokecenter.asm
index a7619f7f..dfd08017 100755
--- a/data/mapObjects/RockTunnelPokecenter.asm
+++ b/data/mapObjects/RockTunnelPokecenter.asm
@@ -7,11 +7,12 @@ RockTunnelPokecenter_Object:
db 0 ; signs
- db 4 ; objects
+ db 5 ; objects
object SPRITE_NURSE, 3, 1, STAY, DOWN, 1 ; person
- object SPRITE_GENTLEMAN, 7, 3, WALK, 2, 2 ; person
+ object SPRITE_GENTLEMAN, 7, 3, STAY, DOWN, 2 ; person
object SPRITE_FISHER2, 2, 5, STAY, NONE, 3 ; person
object SPRITE_CABLE_CLUB_WOMAN, 11, 2, STAY, DOWN, 4 ; person
+ object SPRITE_CHANSEY, 4, 1, STAY, DOWN, 5 ; person
; warp-to
warp_to 3, 7, ROCK_TUNNEL_POKECENTER_WIDTH
diff --git a/data/mapObjects/RocketHideoutB4F.asm b/data/mapObjects/RocketHideoutB4F.asm
index be353f25..ba746951 100755
--- a/data/mapObjects/RocketHideoutB4F.asm
+++ b/data/mapObjects/RocketHideoutB4F.asm
@@ -10,8 +10,8 @@ RocketHideoutB4F_Object:
db 9 ; 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_BALL, 10, 12, STAY, NONE, 5, HP_UP
object SPRITE_BALL, 9, 4, STAY, NONE, 6, TM_02
diff --git a/data/mapObjects/Route11.asm b/data/mapObjects/Route11.asm
index 5ed232f5..a72bf347 100755
--- a/data/mapObjects/Route11.asm
+++ b/data/mapObjects/Route11.asm
@@ -3,9 +3,9 @@ Route11_Object:
db 5 ; 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
db 1 ; signs
diff --git a/data/mapObjects/Route12.asm b/data/mapObjects/Route12.asm
index a9d84cf0..8043b5db 100755
--- a/data/mapObjects/Route12.asm
+++ b/data/mapObjects/Route12.asm
@@ -3,7 +3,7 @@ Route12_Object:
db 4 ; 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/mapObjects/Route15.asm b/data/mapObjects/Route15.asm
index f52cc1b8..10cd8090 100755
--- a/data/mapObjects/Route15.asm
+++ b/data/mapObjects/Route15.asm
@@ -3,9 +3,9 @@ Route15_Object:
db 4 ; 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
db 1 ; signs
sign 39, 9, 12 ; Route15Text12
diff --git a/data/mapObjects/Route16.asm b/data/mapObjects/Route16.asm
index fb23e6ca..93531d13 100755
--- a/data/mapObjects/Route16.asm
+++ b/data/mapObjects/Route16.asm
@@ -3,13 +3,13 @@ Route16_Object:
db 9 ; 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
db 2 ; signs
diff --git a/data/mapObjects/Route18.asm b/data/mapObjects/Route18.asm
index 8bacd6c0..dc6cc6b6 100755
--- a/data/mapObjects/Route18.asm
+++ b/data/mapObjects/Route18.asm
@@ -3,9 +3,9 @@ Route18_Object:
db 4 ; 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
db 2 ; signs
sign 43, 7, 4 ; Route18Text4
diff --git a/data/mapObjects/Route18Gate2F.asm b/data/mapObjects/Route18Gate2F.asm
index e48ec3b8..1981a7f0 100755
--- a/data/mapObjects/Route18Gate2F.asm
+++ b/data/mapObjects/Route18Gate2F.asm
@@ -9,7 +9,7 @@ Route18Gate2F_Object:
sign 6, 2, 3 ; Route18GateUpstairsText3
db 1 ; objects
- object SPRITE_BUG_CATCHER, 4, 2, WALK, 2, 1 ; person
+ object SPRITE_COOK, 4, 2, WALK, 2, 1 ; person
; warp-to
warp_to 7, 7, ROUTE_18_GATE_2F_WIDTH ; ROUTE_18_GATE_1F
diff --git a/data/mapObjects/Route19.asm b/data/mapObjects/Route19.asm
index 9b39618e..d1b3034b 100755
--- a/data/mapObjects/Route19.asm
+++ b/data/mapObjects/Route19.asm
@@ -1,21 +1,23 @@
Route19_Object:
db $43 ; border block
- db 0 ; warps
+ db 1 ; warps
+ warp 5, 9, 0, BEACH_HOUSE
db 1 ; signs
- sign 11, 9, 11 ; Route19Text11
+ sign 11, 11, 11
db 10 ; objects
- object SPRITE_BLACK_HAIR_BOY_1, 8, 7, STAY, LEFT, 1, OPP_SWIMMER, 2
- object SPRITE_BLACK_HAIR_BOY_1, 13, 7, STAY, LEFT, 2, OPP_SWIMMER, 3
+ object SPRITE_BLACK_HAIR_BOY_1, 9, 7, STAY, RIGHT, 1, OPP_SWIMMER, 2
+ object SPRITE_BLACK_HAIR_BOY_1, 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
object SPRITE_SWIMMER, 10, 44, STAY, DOWN, 10, OPP_BEAUTY, 14
; warp-to
+ warp_to 5, 9, ROUTE_19_WIDTH ; BEACH_HOUSE
diff --git a/data/mapObjects/Route2.asm b/data/mapObjects/Route2.asm
index b27ad199..9595fec0 100755
--- a/data/mapObjects/Route2.asm
+++ b/data/mapObjects/Route2.asm
@@ -1,13 +1,14 @@
Route2_Object:
db $f ; border block
- db 6 ; warps
+ db 7 ; warps
warp 12, 9, 0, DIGLETTS_CAVE_ROUTE_2
warp 3, 11, 1, VIRIDIAN_FOREST_NORTH_GATE
warp 15, 19, 0, ROUTE_2_TRADE_HOUSE
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
db 2 ; signs
sign 5, 65, 3 ; Route2Text3
@@ -24,10 +25,12 @@ Route2_Object:
warp_to 16, 35, ROUTE_2_WIDTH ; ROUTE_2_GATE
warp_to 15, 39, ROUTE_2_WIDTH ; ROUTE_2_GATE
warp_to 3, 43, ROUTE_2_WIDTH ; VIRIDIAN_FOREST_SOUTH_GATE
+ warp_to 17, 35, ROUTE_2_WIDTH ; ROUTE_2_GATE
; unused
warp_to 2, 7, 4
- db $12, $c7, $9, $7
+ dw $c712
+ db $9, $7
warp_to 2, 7, 4
warp_to 2, 7, 4
warp_to 2, 7, 4
diff --git a/data/mapObjects/Route22Gate.asm b/data/mapObjects/Route22Gate.asm
index 3f693c7f..e59ca6cf 100755
--- a/data/mapObjects/Route22Gate.asm
+++ b/data/mapObjects/Route22Gate.asm
@@ -5,7 +5,7 @@ Route22Gate_Object:
warp 4, 7, 0, -1
warp 5, 7, 0, -1
warp 4, 0, 0, -1
- warp 5, 0, 1, -1
+ warp 5, 0, 0, -1
db 0 ; signs
diff --git a/data/mapObjects/Route24.asm b/data/mapObjects/Route24.asm
index 8ef0d2b9..5f41c519 100755
--- a/data/mapObjects/Route24.asm
+++ b/data/mapObjects/Route24.asm
@@ -5,7 +5,7 @@ Route24_Object:
db 0 ; signs
- db 8 ; objects
+ db 9 ; objects
object SPRITE_BLACK_HAIR_BOY_1, 11, 15, STAY, LEFT, 1, OPP_ROCKET, 6
object SPRITE_BLACK_HAIR_BOY_1, 5, 20, STAY, UP, 2, OPP_JR_TRAINER_M, 2
object SPRITE_BLACK_HAIR_BOY_1, 11, 19, STAY, LEFT, 3, OPP_JR_TRAINER_M, 3
@@ -14,3 +14,4 @@ Route24_Object:
object SPRITE_LASS, 10, 28, STAY, RIGHT, 6, OPP_LASS, 8
object SPRITE_BUG_CATCHER, 11, 31, STAY, LEFT, 7, OPP_BUG_CATCHER, 9
object SPRITE_BALL, 10, 5, STAY, NONE, 8, TM_45
+ object SPRITE_BLACK_HAIR_BOY_1, 6, 5, STAY, DOWN, 9
diff --git a/data/mapObjects/Route2TradeHouse.asm b/data/mapObjects/Route2TradeHouse.asm
index 89ece3ea..29948d6b 100755
--- a/data/mapObjects/Route2TradeHouse.asm
+++ b/data/mapObjects/Route2TradeHouse.asm
@@ -9,7 +9,7 @@ Route2TradeHouse_Object:
db 2 ; objects
object SPRITE_OAK_AIDE, 2, 4, STAY, RIGHT, 1 ; person
- object SPRITE_GAMEBOY_KID_COPY, 4, 1, STAY, DOWN, 2 ; person
+ object SPRITE_GAMEBOY_KID, 4, 1, STAY, DOWN, 2 ; person
; warp-to
warp_to 2, 7, ROUTE_2_TRADE_HOUSE_WIDTH
diff --git a/data/mapObjects/Route5.asm b/data/mapObjects/Route5.asm
index df2c8c03..fd74edf6 100755
--- a/data/mapObjects/Route5.asm
+++ b/data/mapObjects/Route5.asm
@@ -2,7 +2,7 @@ Route5_Object:
db $a ; border block
db 5 ; 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/mapObjects/Route6.asm b/data/mapObjects/Route6.asm
index fc2d7e24..13825be1 100755
--- a/data/mapObjects/Route6.asm
+++ b/data/mapObjects/Route6.asm
@@ -11,8 +11,8 @@ Route6_Object:
sign 19, 15, 7 ; Route6Text7
db 6 ; objects
- object SPRITE_BLACK_HAIR_BOY_1, 10, 21, STAY, RIGHT, 1, OPP_JR_TRAINER_M, 4
- object SPRITE_LASS, 11, 21, STAY, LEFT, 2, OPP_JR_TRAINER_F, 2
+ object SPRITE_BLACK_HAIR_BOY_1, 10, 21, STAY, RIGHT, 1, OPP_JR_TRAINER_M, 10
+ object SPRITE_LASS, 11, 21, STAY, LEFT, 2, OPP_JR_TRAINER_F, 25
object SPRITE_BUG_CATCHER, 0, 15, STAY, RIGHT, 3, OPP_BUG_CATCHER, 10
object SPRITE_BLACK_HAIR_BOY_1, 11, 31, STAY, LEFT, 4, OPP_JR_TRAINER_M, 5
object SPRITE_LASS, 11, 30, STAY, LEFT, 5, OPP_JR_TRAINER_F, 3
diff --git a/data/mapObjects/Route7.asm b/data/mapObjects/Route7.asm
index 182904ef..3da2fd4b 100755
--- a/data/mapObjects/Route7.asm
+++ b/data/mapObjects/Route7.asm
@@ -3,9 +3,9 @@ Route7_Object:
db 5 ; 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
db 1 ; signs
diff --git a/data/mapObjects/Route7Gate.asm b/data/mapObjects/Route7Gate.asm
index 7f1afe0a..c9dc8dca 100755
--- a/data/mapObjects/Route7Gate.asm
+++ b/data/mapObjects/Route7Gate.asm
@@ -4,7 +4,7 @@ Route7Gate_Object:
db 4 ; warps
warp 0, 3, 3, -1
warp 0, 4, 3, -1
- warp 5, 3, 0, -1
+ warp 5, 3, 1, -1
warp 5, 4, 1, -1
db 0 ; signs
diff --git a/data/mapObjects/Route8.asm b/data/mapObjects/Route8.asm
index 137d70a0..2fc0045c 100755
--- a/data/mapObjects/Route8.asm
+++ b/data/mapObjects/Route8.asm
@@ -3,9 +3,9 @@ Route8_Object:
db 5 ; 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
db 1 ; signs
diff --git a/data/mapObjects/Route8Gate.asm b/data/mapObjects/Route8Gate.asm
index 3bba95a0..008a0fcb 100755
--- a/data/mapObjects/Route8Gate.asm
+++ b/data/mapObjects/Route8Gate.asm
@@ -2,9 +2,9 @@ Route8Gate_Object:
db $a ; border block
db 4 ; warps
- warp 0, 3, 0, -1
+ warp 0, 3, 1, -1
warp 0, 4, 1, -1
- warp 5, 3, 2, -1
+ warp 5, 3, 3, -1
warp 5, 4, 3, -1
db 0 ; signs
diff --git a/data/mapObjects/Route9.asm b/data/mapObjects/Route9.asm
index a991c0c7..c531cf7a 100755
--- a/data/mapObjects/Route9.asm
+++ b/data/mapObjects/Route9.asm
@@ -8,7 +8,7 @@ Route9_Object:
db 10 ; objects
object SPRITE_LASS, 13, 10, STAY, LEFT, 1, OPP_JR_TRAINER_F, 5
- object SPRITE_BLACK_HAIR_BOY_1, 24, 7, STAY, LEFT, 2, OPP_JR_TRAINER_M, 7
+ object SPRITE_BLACK_HAIR_BOY_1, 24, 7, STAY, LEFT, 2, OPP_YOUNGSTER, 14
object SPRITE_BLACK_HAIR_BOY_1, 31, 7, STAY, RIGHT, 3, OPP_JR_TRAINER_M, 8
object SPRITE_LASS, 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/mapObjects/SSAnne1FRooms.asm b/data/mapObjects/SSAnne1FRooms.asm
index 617d2a55..fcd36532 100755
--- a/data/mapObjects/SSAnne1FRooms.asm
+++ b/data/mapObjects/SSAnne1FRooms.asm
@@ -19,7 +19,7 @@ SSAnne1FRooms_Object:
object SPRITE_GIRL, 22, 3, WALK, 1, 5 ; person
object SPRITE_FAT_BALD_GUY, 0, 14, STAY, NONE, 6 ; person
object SPRITE_LITTLE_GIRL, 2, 11, STAY, DOWN, 7 ; person
- object SPRITE_CLEFAIRY, 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_BALL, 12, 15, STAY, NONE, 10, TM_08
object SPRITE_GENTLEMAN, 21, 13, WALK, 2, 11 ; person
diff --git a/data/mapObjects/SaffronCity.asm b/data/mapObjects/SaffronCity.asm
index b8d3a9cf..fd8ed6b1 100755
--- a/data/mapObjects/SaffronCity.asm
+++ b/data/mapObjects/SaffronCity.asm
@@ -23,7 +23,7 @@ SaffronCity_Object:
sign 27, 29, 24 ; SaffronCityText24
sign 1, 19, 25 ; SaffronCityText25
- db 15 ; objects
+ db 14 ; objects
object SPRITE_ROCKET, 7, 6, STAY, NONE, 1 ; person
object SPRITE_ROCKET, 20, 8, WALK, 2, 2 ; person
object SPRITE_ROCKET, 34, 4, STAY, NONE, 3 ; person
@@ -38,7 +38,6 @@ 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
; warp-to
warp_to 7, 5, SAFFRON_CITY_WIDTH ; COPYCATS_HOUSE_1F
diff --git a/data/mapObjects/SaffronGym.asm b/data/mapObjects/SaffronGym.asm
index 1869421a..4cb80bcd 100755
--- a/data/mapObjects/SaffronGym.asm
+++ b/data/mapObjects/SaffronGym.asm
@@ -38,7 +38,7 @@ SaffronGym_Object:
db 0 ; signs
db 9 ; objects
- object SPRITE_GIRL, 9, 8, STAY, DOWN, 1, OPP_SABRINA, 1
+ object SPRITE_LASS, 9, 8, STAY, DOWN, 1, OPP_SABRINA, 1
object SPRITE_MEDIUM, 10, 1, STAY, DOWN, 2, OPP_CHANNELER, 22
object SPRITE_BUG_CATCHER, 17, 1, STAY, DOWN, 3, OPP_PSYCHIC_TR, 1
object SPRITE_MEDIUM, 3, 7, STAY, DOWN, 4, OPP_CHANNELER, 23
diff --git a/data/mapObjects/SaffronPokecenter.asm b/data/mapObjects/SaffronPokecenter.asm
index e54fd76b..db28f048 100755
--- a/data/mapObjects/SaffronPokecenter.asm
+++ b/data/mapObjects/SaffronPokecenter.asm
@@ -7,11 +7,12 @@ SaffronPokecenter_Object:
db 0 ; signs
- db 4 ; objects
+ db 5 ; objects
object SPRITE_NURSE, 3, 1, STAY, DOWN, 1 ; person
object SPRITE_FOULARD_WOMAN, 5, 5, STAY, NONE, 2 ; person
object SPRITE_GENTLEMAN, 8, 3, STAY, DOWN, 3 ; person
object SPRITE_CABLE_CLUB_WOMAN, 11, 2, STAY, DOWN, 4 ; person
+ object SPRITE_CHANSEY, 4, 1, STAY, DOWN, 5 ; person
; warp-to
warp_to 3, 7, SAFFRON_POKECENTER_WIDTH
diff --git a/data/mapObjects/SeafoamIslands1F.asm b/data/mapObjects/SeafoamIslands1F.asm
index 8707ee0a..67b3f0e5 100755
--- a/data/mapObjects/SeafoamIslands1F.asm
+++ b/data/mapObjects/SeafoamIslands1F.asm
@@ -24,7 +24,3 @@ SeafoamIslands1F_Object:
warp_to 7, 5, SEAFOAM_ISLANDS_1F_WIDTH ; SEAFOAM_ISLANDS_B1F
warp_to 25, 3, SEAFOAM_ISLANDS_1F_WIDTH ; SEAFOAM_ISLANDS_B1F
warp_to 23, 15, SEAFOAM_ISLANDS_1F_WIDTH ; SEAFOAM_ISLANDS_B1F
-
- ; holes
- warp_to 17, 6, SEAFOAM_ISLANDS_1F_WIDTH
- warp_to 24, 6, SEAFOAM_ISLANDS_1F_WIDTH
diff --git a/data/mapObjects/SilphCo11F.asm b/data/mapObjects/SilphCo11F.asm
index 7a1dff73..ec6331b2 100755
--- a/data/mapObjects/SilphCo11F.asm
+++ b/data/mapObjects/SilphCo11F.asm
@@ -9,12 +9,13 @@ SilphCo11F_Object:
db 0 ; signs
- db 5 ; objects
+ db 6 ; objects
object SPRITE_MR_MASTERBALL, 7, 5, STAY, DOWN, 1 ; person
object SPRITE_FOULARD_WOMAN, 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
; warp-to
warp_to 9, 0, SILPH_CO_11F_WIDTH ; SILPH_CO_10F
diff --git a/data/mapObjects/TradeCenter.asm b/data/mapObjects/TradeCenter.asm
index e6df8087..e6df8087 100755..100644
--- a/data/mapObjects/TradeCenter.asm
+++ b/data/mapObjects/TradeCenter.asm
diff --git a/data/mapObjects/VermilionCity.asm b/data/mapObjects/VermilionCity.asm
index b1e1a005..646f126a 100755
--- a/data/mapObjects/VermilionCity.asm
+++ b/data/mapObjects/VermilionCity.asm
@@ -13,21 +13,22 @@ VermilionCity_Object:
warp 7, 3, 0, VERMILION_OLD_ROD_HOUSE
db 7 ; 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
- db 6 ; objects
- object SPRITE_FOULARD_WOMAN, 19, 7, WALK, 2, 1 ; person
+ db 7 ; objects
+ object SPRITE_LASS, 19, 7, WALK, 2, 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_SLOWBRO, 29, 9, WALK, 1, 5 ; person
object SPRITE_SAILOR, 25, 27, WALK, 2, 6 ; person
+ object SPRITE_OFFICER_JENNY, 19, 15, STAY, NONE, 7 ; person
; warp-to
warp_to 11, 3, VERMILION_CITY_WIDTH ; VERMILION_POKECENTER
diff --git a/data/mapObjects/VermilionPokecenter.asm b/data/mapObjects/VermilionPokecenter.asm
index d2142045..a99bdf28 100755
--- a/data/mapObjects/VermilionPokecenter.asm
+++ b/data/mapObjects/VermilionPokecenter.asm
@@ -7,11 +7,12 @@ VermilionPokecenter_Object:
db 0 ; signs
- db 4 ; objects
+ db 5 ; objects
object SPRITE_NURSE, 3, 1, STAY, DOWN, 1 ; person
object SPRITE_FISHER, 10, 5, STAY, NONE, 2 ; person
object SPRITE_SAILOR, 5, 4, STAY, NONE, 3 ; person
object SPRITE_CABLE_CLUB_WOMAN, 11, 2, STAY, DOWN, 4 ; person
+ object SPRITE_CHANSEY, 4, 1, STAY, DOWN, 5 ; person
; warp-to
warp_to 3, 7, VERMILION_POKECENTER_WIDTH
diff --git a/data/mapObjects/VermilionTradeHouse.asm b/data/mapObjects/VermilionTradeHouse.asm
index 30212b2a..fcf8a8e9 100755
--- a/data/mapObjects/VermilionTradeHouse.asm
+++ b/data/mapObjects/VermilionTradeHouse.asm
@@ -8,7 +8,7 @@ VermilionTradeHouse_Object:
db 0 ; signs
db 1 ; objects
- object SPRITE_LITTLE_GIRL, 3, 5, STAY, UP, 1 ; person
+ object SPRITE_GENTLEMAN, 3, 5, STAY, UP, 1 ; person
; warp-to
warp_to 2, 7, VERMILION_TRADE_HOUSE_WIDTH
diff --git a/data/mapObjects/ViridianCity.asm b/data/mapObjects/ViridianCity.asm
index 32fe8d3a..9a2a554d 100755
--- a/data/mapObjects/ViridianCity.asm
+++ b/data/mapObjects/ViridianCity.asm
@@ -9,14 +9,14 @@ ViridianCity_Object:
warp 32, 7, 0, VIRIDIAN_GYM
db 6 ; 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
- db 7 ; objects
+ db 8 ; objects
object SPRITE_BUG_CATCHER, 13, 20, WALK, 0, 1 ; person
object SPRITE_GAMBLER, 30, 8, STAY, NONE, 2 ; person
object SPRITE_BUG_CATCHER, 30, 25, WALK, 0, 3 ; person
@@ -24,6 +24,7 @@ ViridianCity_Object:
object SPRITE_LYING_OLD_MAN, 18, 9, STAY, NONE, 5 ; person
object SPRITE_FISHER2, 6, 23, STAY, DOWN, 6 ; person
object SPRITE_GAMBLER, 17, 5, WALK, 2, 7 ; person
+ object SPRITE_GAMBLER, 18, 9, STAY, NONE, 8
; warp-to
warp_to 23, 25, VIRIDIAN_CITY_WIDTH ; VIRIDIAN_POKECENTER
diff --git a/data/mapObjects/ViridianForest.asm b/data/mapObjects/ViridianForest.asm
index cbcb6ff8..94f74b96 100755
--- a/data/mapObjects/ViridianForest.asm
+++ b/data/mapObjects/ViridianForest.asm
@@ -3,29 +3,31 @@ ViridianForest_Object:
db 6 ; 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
db 6 ; 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
- db 8 ; objects
+ db 10 ; objects
object SPRITE_BUG_CATCHER, 16, 43, STAY, NONE, 1 ; person
object SPRITE_BUG_CATCHER, 30, 33, STAY, LEFT, 2, OPP_BUG_CATCHER, 1
object SPRITE_BUG_CATCHER, 30, 19, STAY, LEFT, 3, OPP_BUG_CATCHER, 2
object SPRITE_BUG_CATCHER, 2, 18, STAY, LEFT, 4, OPP_BUG_CATCHER, 3
- object SPRITE_BALL, 25, 11, STAY, NONE, 5, ANTIDOTE
- object SPRITE_BALL, 12, 29, STAY, NONE, 6, POTION
- object SPRITE_BALL, 1, 31, STAY, NONE, 7, POKE_BALL
- object SPRITE_BUG_CATCHER, 27, 40, STAY, NONE, 8 ; person
+ object SPRITE_LASS, 2, 41, STAY, NONE, 5, OPP_LASS, 19
+ object SPRITE_BUG_CATCHER, 13, 17, STAY, RIGHT, 6, OPP_BUG_CATCHER, 15
+ object SPRITE_BALL, 25, 11, STAY, NONE, 7, POTION
+ object SPRITE_BALL, 12, 29, STAY, NONE, 8, POTION
+ object SPRITE_BALL, 1, 31, STAY, NONE, 9, POKE_BALL
+ object SPRITE_BUG_CATCHER, 27, 40, STAY, NONE, 10 ; person
; warp-to
warp_to 1, 0, VIRIDIAN_FOREST_WIDTH ; VIRIDIAN_FOREST_NORTH_GATE
diff --git a/data/mapObjects/ViridianForestSouthGate.asm b/data/mapObjects/ViridianForestSouthGate.asm
index 76f87e51..47432513 100755
--- a/data/mapObjects/ViridianForestSouthGate.asm
+++ b/data/mapObjects/ViridianForestSouthGate.asm
@@ -3,7 +3,7 @@ ViridianForestSouthGate_Object:
db 4 ; warps
warp 4, 0, 3, VIRIDIAN_FOREST
- warp 5, 0, 4, VIRIDIAN_FOREST
+ warp 5, 0, 3, VIRIDIAN_FOREST
warp 4, 7, 5, -1
warp 5, 7, 5, -1
diff --git a/data/mapObjects/ViridianPokecenter.asm b/data/mapObjects/ViridianPokecenter.asm
index 43b73e68..70024ede 100755
--- a/data/mapObjects/ViridianPokecenter.asm
+++ b/data/mapObjects/ViridianPokecenter.asm
@@ -7,11 +7,12 @@ ViridianPokecenter_Object:
db 0 ; signs
- db 4 ; objects
+ db 5 ; objects
object SPRITE_NURSE, 3, 1, STAY, DOWN, 1 ; person
object SPRITE_GENTLEMAN, 10, 5, WALK, 1, 2 ; person
- object SPRITE_BLACK_HAIR_BOY_1, 4, 3, STAY, NONE, 3 ; person
+ object SPRITE_BLACK_HAIR_BOY_1, 4, 3, STAY, UP, 3 ; person
object SPRITE_CABLE_CLUB_WOMAN, 11, 2, STAY, DOWN, 4 ; person
+ object SPRITE_CHANSEY, 4, 1, STAY, DOWN, 5 ; person
; warp-to
warp_to 3, 7, VIRIDIAN_POKECENTER_WIDTH
diff --git a/data/mapObjects/ViridianSchoolHouse.asm b/data/mapObjects/ViridianSchoolHouse.asm
index 01f2465d..29b0614c 100755
--- a/data/mapObjects/ViridianSchoolHouse.asm
+++ b/data/mapObjects/ViridianSchoolHouse.asm
@@ -7,9 +7,10 @@ ViridianSchoolHouse_Object:
db 0 ; signs
- db 2 ; objects
+ db 3 ; objects
object SPRITE_BRUNETTE_GIRL, 3, 5, STAY, UP, 1 ; person
object SPRITE_LASS, 4, 1, STAY, DOWN, 2 ; person
+ object SPRITE_LITTLE_GIRL, 4, 5, STAY, UP, 3 ; person
; warp-to
warp_to 2, 7, VIRIDIAN_SCHOOL_HOUSE_WIDTH
diff --git a/data/map_header_banks.asm b/data/map_header_banks.asm
index 3dc1988a..f52f0d5f 100755..100644
--- a/data/map_header_banks.asm
+++ b/data/map_header_banks.asm
@@ -248,3 +248,4 @@ MapHeaderBanks:
db BANK(LoreleisRoom_h)
db BANK(BrunosRoom_h)
db BANK(AgathasRoom_h)
+ db BANK(BeachHouse_h)
diff --git a/data/map_header_pointers.asm b/data/map_header_pointers.asm
index 9d85eaae..6ea31795 100755..100644
--- a/data/map_header_pointers.asm
+++ b/data/map_header_pointers.asm
@@ -248,3 +248,4 @@ MapHeaderPointers::
dw LoreleisRoom_h
dw BrunosRoom_h
dw AgathasRoom_h ;247
+ dw BeachHouse_h
diff --git a/data/map_songs.asm b/data/map_songs.asm
index 55ec5abf..63417ade 100755..100644
--- a/data/map_songs.asm
+++ b/data/map_songs.asm
@@ -247,3 +247,4 @@ 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) ; BEACH_HOUSE
diff --git a/data/mart_inventories.asm b/data/mart_inventories.asm
index 35ae2e9d..b821f4d7 100755
--- a/data/mart_inventories.asm
+++ b/data/mart_inventories.asm
@@ -3,62 +3,62 @@
; Viridian
ViridianCashierText::
- TX_MART POKE_BALL, ANTIDOTE, PARLYZ_HEAL, BURN_HEAL
+ TX_MART POKE_BALL,POTION,ANTIDOTE,PARLYZ_HEAL,BURN_HEAL
; Pewter
PewterCashierText::
- TX_MART POKE_BALL, POTION, ESCAPE_ROPE, ANTIDOTE, BURN_HEAL, AWAKENING, PARLYZ_HEAL
+ TX_MART POKE_BALL,POTION,ESCAPE_ROPE,ANTIDOTE,BURN_HEAL,AWAKENING,PARLYZ_HEAL
; Cerulean
CeruleanCashierText::
- TX_MART POKE_BALL, POTION, REPEL, ANTIDOTE, BURN_HEAL, AWAKENING, PARLYZ_HEAL
+ TX_MART POKE_BALL,POTION,ESCAPE_ROPE,REPEL,ANTIDOTE,BURN_HEAL,AWAKENING,PARLYZ_HEAL
; Bike shop
TX_MART BICYCLE
; Vermilion
VermilionCashierText::
- TX_MART POKE_BALL, SUPER_POTION, ICE_HEAL, AWAKENING, PARLYZ_HEAL, REPEL
+ TX_MART POKE_BALL,SUPER_POTION,ICE_HEAL,AWAKENING,PARLYZ_HEAL,REPEL
; Lavender
LavenderCashierText::
- TX_MART GREAT_BALL, SUPER_POTION, REVIVE, ESCAPE_ROPE, SUPER_REPEL, ANTIDOTE, BURN_HEAL, ICE_HEAL, PARLYZ_HEAL
+ TX_MART GREAT_BALL,SUPER_POTION,REVIVE,ESCAPE_ROPE,SUPER_REPEL,ANTIDOTE,BURN_HEAL,ICE_HEAL,PARLYZ_HEAL
; Celadon Dept. Store 2F (1)
CeladonMart2Clerk1Text::
- TX_MART GREAT_BALL, SUPER_POTION, REVIVE, SUPER_REPEL, ANTIDOTE, BURN_HEAL, ICE_HEAL, AWAKENING, PARLYZ_HEAL
+ TX_MART GREAT_BALL,SUPER_POTION,REVIVE,SUPER_REPEL,ANTIDOTE,BURN_HEAL,ICE_HEAL,AWAKENING,PARLYZ_HEAL
; Celadon Dept. Store 2F (2)
CeladonMart2Clerk2Text::
- TX_MART TM_32, TM_33, TM_02, TM_07, TM_37, TM_01, TM_05, TM_09, TM_17
+ TX_MART TM_32,TM_33,TM_02,TM_07,TM_37,TM_01,TM_05,TM_09,TM_17
; Celadon Dept. Store 4F
CeladonMart4ClerkText::
- TX_MART POKE_DOLL, FIRE_STONE, THUNDER_STONE, WATER_STONE, LEAF_STONE
+ TX_MART POKE_DOLL,FIRE_STONE,THUNDER_STONE,WATER_STONE,LEAF_STONE
; Celadon Dept. Store 5F (1)
CeladonMart5Clerk1Text::
- TX_MART X_ACCURACY, GUARD_SPEC, DIRE_HIT, X_ATTACK, X_DEFEND, X_SPEED, X_SPECIAL
+ TX_MART X_ACCURACY,GUARD_SPEC,DIRE_HIT,X_ATTACK,X_DEFEND,X_SPEED,X_SPECIAL
; Celadon Dept. Store 5F (2)
CeladonMart5Clerk2Text::
- TX_MART HP_UP, PROTEIN, IRON, CARBOS, CALCIUM
+ TX_MART HP_UP,PROTEIN,IRON,CARBOS,CALCIUM
; Fuchsia
FuchsiaCashierText::
- TX_MART ULTRA_BALL, GREAT_BALL, SUPER_POTION, REVIVE, FULL_HEAL, SUPER_REPEL
+ TX_MART ULTRA_BALL,GREAT_BALL,HYPER_POTION,REVIVE,FULL_HEAL,SUPER_REPEL
; unused?
- TX_MART GREAT_BALL, HYPER_POTION, SUPER_POTION, FULL_HEAL, REVIVE
+ TX_MART GREAT_BALL,HYPER_POTION,SUPER_POTION,FULL_HEAL,REVIVE
; Cinnabar
CinnabarCashierText::
- TX_MART ULTRA_BALL, GREAT_BALL, HYPER_POTION, MAX_REPEL, ESCAPE_ROPE, FULL_HEAL, REVIVE
+ TX_MART ULTRA_BALL,GREAT_BALL,HYPER_POTION,MAX_REPEL,ESCAPE_ROPE,FULL_HEAL,REVIVE
; Saffron
SaffronCashierText::
- TX_MART GREAT_BALL, HYPER_POTION, MAX_REPEL, ESCAPE_ROPE, FULL_HEAL, REVIVE
+ TX_MART GREAT_BALL,HYPER_POTION,MAX_REPEL,ESCAPE_ROPE,FULL_HEAL,REVIVE
; Indigo
IndigoCashierText::
- TX_MART ULTRA_BALL, GREAT_BALL, FULL_RESTORE, MAX_POTION, FULL_HEAL, REVIVE, MAX_REPEL
+ TX_MART ULTRA_BALL,GREAT_BALL,FULL_RESTORE,MAX_POTION,FULL_HEAL,REVIVE,MAX_REPEL
diff --git a/data/mon_party_sprites.asm b/data/mon_party_sprites.asm
index 987d8d28..b94fa0d3 100755
--- a/data/mon_party_sprites.asm
+++ b/data/mon_party_sprites.asm
@@ -1,77 +1,77 @@
MonPartyData:
- dn SPRITE_GRASS, SPRITE_GRASS ;Bulbasaur/Ivysaur
- dn SPRITE_GRASS, SPRITE_MON ;Venusaur/Charmander
- dn SPRITE_MON, SPRITE_MON ;Charmeleon/Charizard
- dn SPRITE_WATER, SPRITE_WATER ;Squirtle/Wartortle
- dn SPRITE_WATER, SPRITE_BUG ;Blastoise/Caterpie
- dn SPRITE_BUG, SPRITE_BUG ;Metapod/Butterfree
- dn SPRITE_BUG, SPRITE_BUG ;Weedle/Kakuna
- dn SPRITE_BUG, SPRITE_BIRD_M ;Beedrill/Pidgey
- dn SPRITE_BIRD_M, SPRITE_BIRD_M ;Pidgeotto/Pidgeot
- dn SPRITE_QUADRUPED, SPRITE_QUADRUPED ;Rattata/Raticate
- dn SPRITE_BIRD_M, SPRITE_BIRD_M ;Spearow/Fearow
- dn SPRITE_SNAKE, SPRITE_SNAKE ;Ekans/Arbok
- dn SPRITE_FAIRY, SPRITE_FAIRY ;Pikachu/Raichu
- dn SPRITE_MON, SPRITE_MON ;Sandshrew/Sandslash
- dn SPRITE_MON, SPRITE_MON ;NidoranF/Nidorina
- dn SPRITE_MON, SPRITE_MON ;Nidoqueen/NidoranM
- dn SPRITE_MON, SPRITE_MON ;Nidorino/Nidoking
- dn SPRITE_FAIRY, SPRITE_FAIRY ;Clefairy/Clefable
- dn SPRITE_QUADRUPED, SPRITE_QUADRUPED ;Vulpix/Ninetales
- dn SPRITE_FAIRY, SPRITE_FAIRY ;Jigglypuff/Wigglytuff
- dn SPRITE_MON, SPRITE_MON ;Zubat/Golbat
- dn SPRITE_GRASS, SPRITE_GRASS ;Oddish/Gloom
- dn SPRITE_GRASS, SPRITE_BUG ;Vileplume/Paras
- dn SPRITE_BUG, SPRITE_BUG ;Parasect/Venonat
- dn SPRITE_BUG, SPRITE_MON ;Venomoth/Diglett
- dn SPRITE_MON, SPRITE_MON ;Dugtrio/Meowth
- dn SPRITE_MON, SPRITE_MON ;Persian/Psyduck
- dn SPRITE_MON, SPRITE_MON ;Golduck/Mankey
- dn SPRITE_MON, SPRITE_QUADRUPED ;Primeape/Growlithe
- dn SPRITE_QUADRUPED, SPRITE_MON ;Arcanine/Poliwag
- dn SPRITE_MON, SPRITE_MON ;Poliwhirl/Poliwrath
- dn SPRITE_MON, SPRITE_MON ;Abra/Kadabra
- dn SPRITE_MON, SPRITE_MON ;Alakazam/Machop
- dn SPRITE_MON, SPRITE_MON ;Machoke/Machamp
- dn SPRITE_GRASS, SPRITE_GRASS ;Bellsprout/Weepinbell
- dn SPRITE_GRASS, SPRITE_WATER ;Victreebel/Tentacool
- dn SPRITE_WATER, SPRITE_MON ;Tentacruel/Geodude
- dn SPRITE_MON, SPRITE_MON ;Graveler/Golem
- dn SPRITE_QUADRUPED, SPRITE_QUADRUPED ;Ponyta/Rapidash
- dn SPRITE_QUADRUPED, SPRITE_MON ;Slowpoke/Slowbro
- dn SPRITE_BALL_M, SPRITE_BALL_M ;Magnemite/Magneton
- dn SPRITE_BIRD_M, SPRITE_BIRD_M ;Farfetch'd/Doduo
- dn SPRITE_BIRD_M, SPRITE_WATER ;Dodrio/Seel
- dn SPRITE_WATER, SPRITE_MON ;Dewgong/Grimer
- dn SPRITE_MON, SPRITE_HELIX ;Muk/Shellder
- dn SPRITE_HELIX, SPRITE_MON ;Cloyster/Gastly
- dn SPRITE_MON, SPRITE_MON ;Haunter/Gengar
- dn SPRITE_SNAKE, SPRITE_MON ;Onix/Drowzee
- dn SPRITE_MON, SPRITE_WATER ;Hypno/Krabby
- dn SPRITE_WATER, SPRITE_BALL_M ;Kingler/Voltorb
- dn SPRITE_BALL_M, SPRITE_GRASS ;Electrode/Exeggcute
- dn SPRITE_GRASS, SPRITE_MON ;Exeggutor/Cubone
- dn SPRITE_MON, SPRITE_MON ;Marowak/Hitmonlee
- dn SPRITE_MON, SPRITE_MON ;Hitmonchan/Lickitung
- dn SPRITE_MON, SPRITE_MON ;Koffing/Weezing
- dn SPRITE_QUADRUPED, SPRITE_MON ;Rhyhorn/Rhydon
- dn SPRITE_FAIRY, SPRITE_GRASS ;Chansey/Tangela
- dn SPRITE_MON, SPRITE_WATER ;Kangaskhan/Horsea
- dn SPRITE_WATER, SPRITE_WATER ;Seadra/Goldeen
- dn SPRITE_WATER, SPRITE_HELIX ;Seaking/Staryu
- dn SPRITE_HELIX, SPRITE_MON ;Starmie/Mr.Mime
- dn SPRITE_BUG, SPRITE_MON ;Scyther/Jynx
- dn SPRITE_MON, SPRITE_MON ;Electabuzz/Magmar
- dn SPRITE_BUG, SPRITE_QUADRUPED ;Pinsir/Tauros
- dn SPRITE_WATER, SPRITE_SNAKE ;Magikarp/Gyarados
- dn SPRITE_WATER, SPRITE_MON ;Lapras/Ditto
- dn SPRITE_QUADRUPED, SPRITE_QUADRUPED ;Eevee/Vaporeon
- dn SPRITE_QUADRUPED, SPRITE_QUADRUPED ;Jolteon/Flareon
- dn SPRITE_MON, SPRITE_HELIX ;Porygon/Omanyte
- dn SPRITE_HELIX, SPRITE_HELIX ;Omastar/Kabuto
- dn SPRITE_HELIX, SPRITE_BIRD_M ;Kabutops/Aerodactyl
- dn SPRITE_MON, SPRITE_BIRD_M ;Snorlax/Articuno
- dn SPRITE_BIRD_M, SPRITE_BIRD_M ;Zapdos/Moltres
- dn SPRITE_SNAKE, SPRITE_SNAKE ;Dratini/Dragonair
- dn SPRITE_SNAKE, SPRITE_MON ;Dragonite/Mewtwo
- dn SPRITE_MON, 0 ;Mew/Padding
+ dn SPRITE_GRASS, SPRITE_GRASS ;Bulbasaur/Ivysaur
+ dn SPRITE_GRASS, SPRITE_MON ;Venusaur/Charmander
+ dn SPRITE_MON, SPRITE_MON ;Charmeleon/Charizard
+ dn SPRITE_WATER, SPRITE_WATER ;Squirtle/Wartortle
+ dn SPRITE_WATER, SPRITE_BUG ;Blastoise/Caterpie
+ dn SPRITE_BUG, SPRITE_BUG ;Metapod/Butterfree
+ dn SPRITE_BUG, SPRITE_BUG ;Weedle/Kakuna
+ dn SPRITE_BUG, SPRITE_BIRD_M ;Beedrill/Pidgey
+ dn SPRITE_BIRD_M, SPRITE_BIRD_M ;Pidgeotto/Pidgeot
+ dn SPRITE_QUADRUPED, SPRITE_QUADRUPED ;Rattata/Raticate
+ dn SPRITE_BIRD_M, SPRITE_BIRD_M ;Spearow/Fearow
+ dn SPRITE_SNAKE, SPRITE_SNAKE ;Ekans/Arbok
+ dn SPRITE_PIKACHU_FAMILY, SPRITE_PIKACHU_FAMILY ;Pikachu/Raichu
+ dn SPRITE_MON, SPRITE_MON ;Sandshrew/Sandslash
+ dn SPRITE_MON, SPRITE_MON ;NidoranF/Nidorina
+ dn SPRITE_MON, SPRITE_MON ;Nidoqueen/NidoranM
+ dn SPRITE_MON, SPRITE_MON ;Nidorino/Nidoking
+ dn SPRITE_FAIRY, SPRITE_FAIRY ;Clefairy/Clefable
+ dn SPRITE_QUADRUPED, SPRITE_QUADRUPED ;Vulpix/Ninetales
+ dn SPRITE_FAIRY, SPRITE_FAIRY ;Jigglypuff/Wigglytuff
+ dn SPRITE_MON, SPRITE_MON ;Zubat/Golbat
+ dn SPRITE_GRASS, SPRITE_GRASS ;Oddish/Gloom
+ dn SPRITE_GRASS, SPRITE_BUG ;Vileplume/Paras
+ dn SPRITE_BUG, SPRITE_BUG ;Parasect/Venonat
+ dn SPRITE_BUG, SPRITE_MON ;Venomoth/Diglett
+ dn SPRITE_MON, SPRITE_MON ;Dugtrio/Meowth
+ dn SPRITE_MON, SPRITE_MON ;Persian/Psyduck
+ dn SPRITE_MON, SPRITE_MON ;Golduck/Mankey
+ dn SPRITE_MON, SPRITE_QUADRUPED ;Primeape/Growlithe
+ dn SPRITE_QUADRUPED, SPRITE_MON ;Arcanine/Poliwag
+ dn SPRITE_MON, SPRITE_MON ;Poliwhirl/Poliwrath
+ dn SPRITE_MON, SPRITE_MON ;Abra/Kadabra
+ dn SPRITE_MON, SPRITE_MON ;Alakazam/Machop
+ dn SPRITE_MON, SPRITE_MON ;Machoke/Machamp
+ dn SPRITE_GRASS, SPRITE_GRASS ;Bellsprout/Weepinbell
+ dn SPRITE_GRASS, SPRITE_WATER ;Victreebel/Tentacool
+ dn SPRITE_WATER, SPRITE_MON ;Tentacruel/Geodude
+ dn SPRITE_MON, SPRITE_MON ;Graveler/Golem
+ dn SPRITE_QUADRUPED, SPRITE_QUADRUPED ;Ponyta/Rapidash
+ dn SPRITE_QUADRUPED, SPRITE_MON ;Slowpoke/Slowbro
+ dn SPRITE_BALL_M, SPRITE_BALL_M ;Magnemite/Magneton
+ dn SPRITE_BIRD_M, SPRITE_BIRD_M ;Farfetch'd/Doduo
+ dn SPRITE_BIRD_M, SPRITE_WATER ;Dodrio/Seel
+ dn SPRITE_WATER, SPRITE_MON ;Dewgong/Grimer
+ dn SPRITE_MON, SPRITE_HELIX ;Muk/Shellder
+ dn SPRITE_HELIX, SPRITE_MON ;Cloyster/Gastly
+ dn SPRITE_MON, SPRITE_MON ;Haunter/Gengar
+ dn SPRITE_SNAKE, SPRITE_MON ;Onix/Drowzee
+ dn SPRITE_MON, SPRITE_WATER ;Hypno/Krabby
+ dn SPRITE_WATER, SPRITE_BALL_M ;Kingler/Voltorb
+ dn SPRITE_BALL_M, SPRITE_GRASS ;Electrode/Exeggcute
+ dn SPRITE_GRASS, SPRITE_MON ;Exeggutor/Cubone
+ dn SPRITE_MON, SPRITE_MON ;Marowak/Hitmonlee
+ dn SPRITE_MON, SPRITE_MON ;Hitmonchan/Lickitung
+ dn SPRITE_MON, SPRITE_MON ;Koffing/Weezing
+ dn SPRITE_QUADRUPED, SPRITE_MON ;Rhyhorn/Rhydon
+ dn SPRITE_FAIRY, SPRITE_GRASS ;Chansey/Tangela
+ dn SPRITE_MON, SPRITE_WATER ;Kangaskhan/Horsea
+ dn SPRITE_WATER, SPRITE_WATER ;Seadra/Goldeen
+ dn SPRITE_WATER, SPRITE_HELIX ;Seaking/Staryu
+ dn SPRITE_HELIX, SPRITE_MON ;Starmie/Mr.Mime
+ dn SPRITE_BUG, SPRITE_MON ;Scyther/Jynx
+ dn SPRITE_MON, SPRITE_MON ;Electabuzz/Magmar
+ dn SPRITE_BUG, SPRITE_QUADRUPED ;Pinsir/Tauros
+ dn SPRITE_WATER, SPRITE_SNAKE ;Magikarp/Gyarados
+ dn SPRITE_WATER, SPRITE_MON ;Lapras/Ditto
+ dn SPRITE_QUADRUPED, SPRITE_QUADRUPED ;Eevee/Vaporeon
+ dn SPRITE_QUADRUPED, SPRITE_QUADRUPED ;Jolteon/Flareon
+ dn SPRITE_MON, SPRITE_HELIX ;Porygon/Omanyte
+ dn SPRITE_HELIX, SPRITE_HELIX ;Omastar/Kabuto
+ dn SPRITE_HELIX, SPRITE_BIRD_M ;Kabutops/Aerodactyl
+ dn SPRITE_MON, SPRITE_BIRD_M ;Snorlax/Articuno
+ dn SPRITE_BIRD_M, SPRITE_BIRD_M ;Zapdos/Moltres
+ dn SPRITE_SNAKE, SPRITE_SNAKE ;Dratini/Dragonair
+ dn SPRITE_SNAKE, SPRITE_MON ;Dragonite/Mewtwo
+ dn SPRITE_MON, 0 ;Mew/Padding
diff --git a/data/pikachu_emotions.asm b/data/pikachu_emotions.asm
new file mode 100755
index 00000000..f72beaa4
--- /dev/null
+++ b/data/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_pic_animation.asm b/data/pikachu_pic_animation.asm
new file mode 100755
index 00000000..d10f65dd
--- /dev/null
+++ b/data/pikachu_pic_animation.asm
@@ -0,0 +1,399 @@
+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 $ff
+
+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
+
+PikaPicAnimGFXHeaders:
+pikapicanimgfx: MACRO
+\2_id::
+ db \1 ; size (-1 if compressed)
+ dba \2 ; pointer
+ endm
+
+PikaPicAnimGFX_Null_id::
+ dbbw 1, $39,$0000 ; 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_pic_objects.asm b/data/pikachu_pic_objects.asm
new file mode 100755
index 00000000..940c1141
--- /dev/null
+++ b/data/pikachu_pic_objects.asm
@@ -0,0 +1,300 @@
+PikaPicAnimBGFramesPointers:
+pikaanim_def: macro
+\1_id: dw \1
+ endm
+
+ 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
+
+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_pic_tilemaps.asm b/data/pikachu_pic_tilemaps.asm
new file mode 100755
index 00000000..95882711
--- /dev/null
+++ b/data/pikachu_pic_tilemaps.asm
@@ -0,0 +1,253 @@
+PikaPicTilemapPointers:
+pikatilemap_def: macro
+\1_id: dw \1
+ endm
+
+ 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 $ff ; 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/pokedex_entries.asm b/data/pokedex_entries.asm
index 495a8e33..a1dad53a 100755
--- a/data/pokedex_entries.asm
+++ b/data/pokedex_entries.asm
@@ -195,60 +195,11 @@ PokedexEntryPointers:
; weight in pounds
; text entry
-RhydonDexEntry:
- db "DRILL@"
- db 6,3
- dw 2650
- TX_FAR _RhydonDexEntry
- db "@"
-
-KangaskhanDexEntry:
- db "PARENT@"
- db 7,3
- dw 1760
- TX_FAR _KangaskhanDexEntry
- db "@"
-
-NidoranMDexEntry:
- db "POISON PIN@"
- db 1,8
- dw 200
- TX_FAR _NidoranMDexEntry
- db "@"
-
-ClefairyDexEntry:
- db "FAIRY@"
- db 2,0
- dw 170
- TX_FAR _ClefairyDexEntry
- db "@"
-
-SpearowDexEntry:
- db "TINY BIRD@"
- db 1,0
- dw 40
- TX_FAR _SpearowDexEntry
- db "@"
-
-VoltorbDexEntry:
- db "BALL@"
- db 1,8
- dw 230
- TX_FAR _VoltorbDexEntry
- db "@"
-
-NidokingDexEntry:
- db "DRILL@"
- db 4,7
- dw 1370
- TX_FAR _NidokingDexEntry
- db "@"
-
-SlowbroDexEntry:
- db "HERMITCRAB@"
- db 5,3
- dw 1730
- TX_FAR _SlowbroDexEntry
+BulbasaurDexEntry:
+ db "SEED@"
+ db 2,4
+ dw 150
+ TX_FAR _BulbasaurDexEntry
db "@"
IvysaurDexEntry:
@@ -258,165 +209,137 @@ IvysaurDexEntry:
TX_FAR _IvysaurDexEntry
db "@"
-ExeggutorDexEntry:
- db "COCONUT@"
+VenusaurDexEntry:
+ db "SEED@"
db 6,7
- dw 2650
- TX_FAR _ExeggutorDexEntry
- db "@"
-
-LickitungDexEntry:
- db "LICKING@"
- db 3,11
- dw 1440
- TX_FAR _LickitungDexEntry
- db "@"
-
-ExeggcuteDexEntry:
- db "EGG@"
- db 1,4
- dw 60
- TX_FAR _ExeggcuteDexEntry
- db "@"
-
-GrimerDexEntry:
- db "SLUDGE@"
- db 2,11
- dw 660
- TX_FAR _GrimerDexEntry
+ dw 2210
+ TX_FAR _VenusaurDexEntry
db "@"
-GengarDexEntry:
- db "SHADOW@"
- db 4,11
- dw 890
- TX_FAR _GengarDexEntry
+CharmanderDexEntry:
+ db "LIZARD@"
+ db 2,0
+ dw 190
+ TX_FAR _CharmanderDexEntry
db "@"
-NidoranFDexEntry:
- db "POISON PIN@"
- db 1,4
- dw 150
- TX_FAR _NidoranFDexEntry
+CharmeleonDexEntry:
+ db "FLAME@"
+ db 3,7
+ dw 420
+ TX_FAR _CharmeleonDexEntry
db "@"
-NidoqueenDexEntry:
- db "DRILL@"
- db 4,3
- dw 1320
- TX_FAR _NidoqueenDexEntry
+CharizardDexEntry:
+ db "FLAME@"
+ db 5,7
+ dw 2000
+ TX_FAR _CharizardDexEntry
db "@"
-CuboneDexEntry:
- db "LONELY@"
- db 1,4
- dw 140
- TX_FAR _CuboneDexEntry
+SquirtleDexEntry:
+ db "TINYTURTLE@"
+ db 1,8
+ dw 200
+ TX_FAR _SquirtleDexEntry
db "@"
-RhyhornDexEntry:
- db "SPIKES@"
+WartortleDexEntry:
+ db "TURTLE@"
db 3,3
- dw 2540
- TX_FAR _RhyhornDexEntry
+ dw 500
+ TX_FAR _WartortleDexEntry
db "@"
-LaprasDexEntry:
- db "TRANSPORT@"
- db 8,2
- dw 4850
- TX_FAR _LaprasDexEntry
+BlastoiseDexEntry:
+ db "SHELLFISH@"
+ db 5,3
+ dw 1890
+ TX_FAR _BlastoiseDexEntry
db "@"
-ArcanineDexEntry:
- db "LEGENDARY@"
- db 6,3
- dw 3420
- TX_FAR _ArcanineDexEntry
+CaterpieDexEntry:
+ db "WORM@"
+ db 1,0
+ dw 60
+ TX_FAR _CaterpieDexEntry
db "@"
-MewDexEntry:
- db "NEW SPECIE@"
- db 1,4
- dw 90
- TX_FAR _MewDexEntry
+MetapodDexEntry:
+ db "COCOON@"
+ db 2,4
+ dw 220
+ TX_FAR _MetapodDexEntry
db "@"
-GyaradosDexEntry:
- db "ATROCIOUS@"
- db 21,4
- dw 5180
- TX_FAR _GyaradosDexEntry
+ButterfreeDexEntry:
+ db "BUTTERFLY@"
+ db 3,7
+ dw 710
+ TX_FAR _ButterfreeDexEntry
db "@"
-ShellderDexEntry:
- db "BIVALVE@"
+WeedleDexEntry:
+ db "HAIRY BUG@"
db 1,0
- dw 90
- TX_FAR _ShellderDexEntry
- db "@"
-
-TentacoolDexEntry:
- db "JELLYFISH@"
- db 2,11
- dw 1000
- TX_FAR _TentacoolDexEntry
+ dw 70
+ TX_FAR _WeedleDexEntry
db "@"
-GastlyDexEntry:
- db "GAS@"
- db 4,3
- dw 2
- TX_FAR _GastlyDexEntry
+KakunaDexEntry:
+ db "COCOON@"
+ db 2,0
+ dw 220
+ TX_FAR _KakunaDexEntry
db "@"
-ScytherDexEntry:
- db "MANTIS@"
- db 4,11
- dw 1230
- TX_FAR _ScytherDexEntry
+BeedrillDexEntry:
+ db "POISON BEE@"
+ db 3,3
+ dw 650
+ TX_FAR _BeedrillDexEntry
db "@"
-StaryuDexEntry:
- db "STARSHAPE@"
- db 2,7
- dw 760
- TX_FAR _StaryuDexEntry
+PidgeyDexEntry:
+ db "TINY BIRD@"
+ db 1,0
+ dw 40
+ TX_FAR _PidgeyDexEntry
db "@"
-BlastoiseDexEntry:
- db "SHELLFISH@"
- db 5,3
- dw 1890
- TX_FAR _BlastoiseDexEntry
+PidgeottoDexEntry:
+ db "BIRD@"
+ db 3,7
+ dw 660
+ TX_FAR _PidgeottoDexEntry
db "@"
-PinsirDexEntry:
- db "STAGBEETLE@"
+PidgeotDexEntry:
+ db "BIRD@"
db 4,11
- dw 1210
- TX_FAR _PinsirDexEntry
+ dw 870
+ TX_FAR _PidgeotDexEntry
db "@"
-TangelaDexEntry:
- db "VINE@"
- db 3,3
- dw 770
- TX_FAR _TangelaDexEntry
+RattataDexEntry:
+ db "RAT@"
+ db 1,0
+ dw 80
+ TX_FAR _RattataDexEntry
db "@"
-GrowlitheDexEntry:
- db "PUPPY@"
+RaticateDexEntry:
+ db "RAT@"
db 2,4
- dw 420
- TX_FAR _GrowlitheDexEntry
+ dw 410
+ TX_FAR _RaticateDexEntry
db "@"
-OnixDexEntry:
- db "ROCK SNAKE@"
- db 28,10
- dw 4630
- TX_FAR _OnixDexEntry
+SpearowDexEntry:
+ db "TINY BIRD@"
+ db 1,0
+ dw 40
+ TX_FAR _SpearowDexEntry
db "@"
FearowDexEntry:
@@ -426,165 +349,179 @@ FearowDexEntry:
TX_FAR _FearowDexEntry
db "@"
-PidgeyDexEntry:
- db "TINY BIRD@"
- db 1,0
- dw 40
- TX_FAR _PidgeyDexEntry
- db "@"
-
-SlowpokeDexEntry:
- db "DOPEY@"
- db 3,11
- dw 790
- TX_FAR _SlowpokeDexEntry
+EkansDexEntry:
+ db "SNAKE@"
+ db 6,7
+ dw 150
+ TX_FAR _EkansDexEntry
db "@"
-KadabraDexEntry:
- db "PSI@"
- db 4,3
- dw 1250
- TX_FAR _KadabraDexEntry
+ArbokDexEntry:
+ db "COBRA@"
+ db 11,6
+ dw 1430
+ TX_FAR _ArbokDexEntry
db "@"
-GravelerDexEntry:
- db "ROCK@"
- db 3,3
- dw 2320
- TX_FAR _GravelerDexEntry
+PikachuDexEntry:
+ db "MOUSE@"
+ db 1,4
+ dw 130
+ TX_FAR _PikachuDexEntry
db "@"
-ChanseyDexEntry:
- db "EGG@"
- db 3,7
- dw 760
- TX_FAR _ChanseyDexEntry
+RaichuDexEntry:
+ db "MOUSE@"
+ db 2,7
+ dw 660
+ TX_FAR _RaichuDexEntry
db "@"
-MachokeDexEntry:
- db "SUPERPOWER@"
- db 4,11
- dw 1550
- TX_FAR _MachokeDexEntry
+SandshrewDexEntry:
+ db "MOUSE@"
+ db 2,0
+ dw 260
+ TX_FAR _SandshrewDexEntry
db "@"
-MrMimeDexEntry:
- db "BARRIER@"
- db 4,3
- dw 1200
- TX_FAR _MrMimeDexEntry
+SandslashDexEntry:
+ db "MOUSE@"
+ db 3,3
+ dw 650
+ TX_FAR _SandslashDexEntry
db "@"
-HitmonleeDexEntry:
- db "KICKING@"
- db 4,11
- dw 1100
- TX_FAR _HitmonleeDexEntry
+NidoranFDexEntry:
+ db "POISON PIN@"
+ db 1,4
+ dw 150
+ TX_FAR _NidoranFDexEntry
db "@"
-HitmonchanDexEntry:
- db "PUNCHING@"
- db 4,7
- dw 1110
- TX_FAR _HitmonchanDexEntry
+NidorinaDexEntry:
+ db "POISON PIN@"
+ db 2,7
+ dw 440
+ TX_FAR _NidorinaDexEntry
db "@"
-ArbokDexEntry:
- db "COBRA@"
- db 11,6
- dw 1430
- TX_FAR _ArbokDexEntry
+NidoqueenDexEntry:
+ db "DRILL@"
+ db 4,3
+ dw 1320
+ TX_FAR _NidoqueenDexEntry
db "@"
-ParasectDexEntry:
- db "MUSHROOM@"
- db 3,3
- dw 650
- TX_FAR _ParasectDexEntry
+NidoranMDexEntry:
+ db "POISON PIN@"
+ db 1,8
+ dw 200
+ TX_FAR _NidoranMDexEntry
db "@"
-PsyduckDexEntry:
- db "DUCK@"
- db 2,7
+NidorinoDexEntry:
+ db "POISON PIN@"
+ db 2,11
dw 430
- TX_FAR _PsyduckDexEntry
+ TX_FAR _NidorinoDexEntry
db "@"
-DrowzeeDexEntry:
- db "HYPNOSIS@"
- db 3,3
- dw 710
- TX_FAR _DrowzeeDexEntry
+NidokingDexEntry:
+ db "DRILL@"
+ db 4,7
+ dw 1370
+ TX_FAR _NidokingDexEntry
db "@"
-GolemDexEntry:
- db "MEGATON@"
- db 4,7
- dw 6620
- TX_FAR _GolemDexEntry
+ClefairyDexEntry:
+ db "FAIRY@"
+ db 2,0
+ dw 170
+ TX_FAR _ClefairyDexEntry
db "@"
-MagmarDexEntry:
- db "SPITFIRE@"
+ClefableDexEntry:
+ db "FAIRY@"
db 4,3
- dw 980
- TX_FAR _MagmarDexEntry
+ dw 880
+ TX_FAR _ClefableDexEntry
db "@"
-ElectabuzzDexEntry:
- db "ELECTRIC@"
+VulpixDexEntry:
+ db "FOX@"
+ db 2,0
+ dw 220
+ TX_FAR _VulpixDexEntry
+ db "@"
+
+NinetalesDexEntry:
+ db "FOX@"
db 3,7
- dw 660
- TX_FAR _ElectabuzzDexEntry
+ dw 440
+ TX_FAR _NinetalesDexEntry
db "@"
-MagnetonDexEntry:
- db "MAGNET@"
+JigglypuffDexEntry:
+ db "BALLOON@"
+ db 1,8
+ dw 120
+ TX_FAR _JigglypuffDexEntry
+ db "@"
+
+WigglytuffDexEntry:
+ db "BALLOON@"
db 3,3
- dw 1320
- TX_FAR _MagnetonDexEntry
+ dw 260
+ TX_FAR _WigglytuffDexEntry
db "@"
-KoffingDexEntry:
- db "POISON GAS@"
- db 2,0
- dw 20
- TX_FAR _KoffingDexEntry
+ZubatDexEntry:
+ db "BAT@"
+ db 2,7
+ dw 170
+ TX_FAR _ZubatDexEntry
db "@"
-MankeyDexEntry:
- db "PIG MONKEY@"
+GolbatDexEntry:
+ db "BAT@"
+ db 5,3
+ dw 1210
+ TX_FAR _GolbatDexEntry
+ db "@"
+
+OddishDexEntry:
+ db "WEED@"
db 1,8
- dw 620
- TX_FAR _MankeyDexEntry
+ dw 120
+ TX_FAR _OddishDexEntry
db "@"
-SeelDexEntry:
- db "SEA LION@"
- db 3,7
- dw 1980
- TX_FAR _SeelDexEntry
+GloomDexEntry:
+ db "WEED@"
+ db 2,7
+ dw 190
+ TX_FAR _GloomDexEntry
db "@"
-DiglettDexEntry:
- db "MOLE@"
- db 0,8
- dw 20
- TX_FAR _DiglettDexEntry
+VileplumeDexEntry:
+ db "FLOWER@"
+ db 3,11
+ dw 410
+ TX_FAR _VileplumeDexEntry
db "@"
-TaurosDexEntry:
- db "WILD BULL@"
- db 4,7
- dw 1950
- TX_FAR _TaurosDexEntry
+ParasDexEntry:
+ db "MUSHROOM@"
+ db 1,0
+ dw 120
+ TX_FAR _ParasDexEntry
db "@"
-FarfetchdDexEntry:
- db "WILD DUCK@"
- db 2,7
- dw 330
- TX_FAR _FarfetchdDexEntry
+ParasectDexEntry:
+ db "MUSHROOM@"
+ db 3,3
+ dw 650
+ TX_FAR _ParasectDexEntry
db "@"
VenonatDexEntry:
@@ -594,60 +531,25 @@ VenonatDexEntry:
TX_FAR _VenonatDexEntry
db "@"
-DragoniteDexEntry:
- db "DRAGON@"
- db 7,3
- dw 4630
- TX_FAR _DragoniteDexEntry
- db "@"
-
-DoduoDexEntry:
- db "TWIN BIRD@"
- db 4,7
- dw 860
- TX_FAR _DoduoDexEntry
- db "@"
-
-PoliwagDexEntry:
- db "TADPOLE@"
- db 2,0
- dw 270
- TX_FAR _PoliwagDexEntry
- db "@"
-
-JynxDexEntry:
- db "HUMANSHAPE@"
- db 4,7
- dw 900
- TX_FAR _JynxDexEntry
- db "@"
-
-MoltresDexEntry:
- db "FLAME@"
- db 6,7
- dw 1320
- TX_FAR _MoltresDexEntry
- db "@"
-
-ArticunoDexEntry:
- db "FREEZE@"
- db 5,7
- dw 1220
- TX_FAR _ArticunoDexEntry
+VenomothDexEntry:
+ db "POISONMOTH@"
+ db 4,11
+ dw 280
+ TX_FAR _VenomothDexEntry
db "@"
-ZapdosDexEntry:
- db "ELECTRIC@"
- db 5,3
- dw 1160
- TX_FAR _ZapdosDexEntry
+DiglettDexEntry:
+ db "MOLE@"
+ db 0,8
+ dw 20
+ TX_FAR _DiglettDexEntry
db "@"
-DittoDexEntry:
- db "TRANSFORM@"
- db 1,0
- dw 90
- TX_FAR _DittoDexEntry
+DugtrioDexEntry:
+ db "MOLE@"
+ db 2,4
+ dw 730
+ TX_FAR _DugtrioDexEntry
db "@"
MeowthDexEntry:
@@ -657,214 +559,228 @@ MeowthDexEntry:
TX_FAR _MeowthDexEntry
db "@"
-KrabbyDexEntry:
- db "RIVER CRAB@"
- db 1,4
- dw 140
- TX_FAR _KrabbyDexEntry
+PersianDexEntry:
+ db "CLASSY CAT@"
+ db 3,3
+ dw 710
+ TX_FAR _PersianDexEntry
db "@"
-VulpixDexEntry:
- db "FOX@"
- db 2,0
- dw 220
- TX_FAR _VulpixDexEntry
+PsyduckDexEntry:
+ db "DUCK@"
+ db 2,7
+ dw 430
+ TX_FAR _PsyduckDexEntry
db "@"
-NinetalesDexEntry:
- db "FOX@"
- db 3,7
- dw 440
- TX_FAR _NinetalesDexEntry
+GolduckDexEntry:
+ db "DUCK@"
+ db 5,7
+ dw 1690
+ TX_FAR _GolduckDexEntry
db "@"
-PikachuDexEntry:
- db "MOUSE@"
- db 1,4
- dw 130
- TX_FAR _PikachuDexEntry
+MankeyDexEntry:
+ db "PIG MONKEY@"
+ db 1,8
+ dw 620
+ TX_FAR _MankeyDexEntry
db "@"
-RaichuDexEntry:
- db "MOUSE@"
- db 2,7
- dw 660
- TX_FAR _RaichuDexEntry
+PrimeapeDexEntry:
+ db "PIG MONKEY@"
+ db 3,3
+ dw 710
+ TX_FAR _PrimeapeDexEntry
db "@"
-DratiniDexEntry:
- db "DRAGON@"
- db 5,11
- dw 70
- TX_FAR _DratiniDexEntry
+GrowlitheDexEntry:
+ db "PUPPY@"
+ db 2,4
+ dw 420
+ TX_FAR _GrowlitheDexEntry
db "@"
-DragonairDexEntry:
- db "DRAGON@"
- db 13,1
- dw 360
- TX_FAR _DragonairDexEntry
+ArcanineDexEntry:
+ db "LEGENDARY@"
+ db 6,3
+ dw 3420
+ TX_FAR _ArcanineDexEntry
db "@"
-KabutoDexEntry:
- db "SHELLFISH@"
- db 1,8
- dw 250
- TX_FAR _KabutoDexEntry
+PoliwagDexEntry:
+ db "TADPOLE@"
+ db 2,0
+ dw 270
+ TX_FAR _PoliwagDexEntry
db "@"
-KabutopsDexEntry:
- db "SHELLFISH@"
+PoliwhirlDexEntry:
+ db "TADPOLE@"
+ db 3,3
+ dw 440
+ TX_FAR _PoliwhirlDexEntry
+ db "@"
+
+PoliwrathDexEntry:
+ db "TADPOLE@"
db 4,3
- dw 890
- TX_FAR _KabutopsDexEntry
+ dw 1190
+ TX_FAR _PoliwrathDexEntry
db "@"
-HorseaDexEntry:
- db "DRAGON@"
- db 1,4
- dw 180
- TX_FAR _HorseaDexEntry
+AbraDexEntry:
+ db "PSI@"
+ db 2,11
+ dw 430
+ TX_FAR _AbraDexEntry
db "@"
-SeadraDexEntry:
- db "DRAGON@"
- db 3,11
- dw 550
- TX_FAR _SeadraDexEntry
+KadabraDexEntry:
+ db "PSI@"
+ db 4,3
+ dw 1250
+ TX_FAR _KadabraDexEntry
db "@"
-SandshrewDexEntry:
- db "MOUSE@"
- db 2,0
- dw 260
- TX_FAR _SandshrewDexEntry
+AlakazamDexEntry:
+ db "PSI@"
+ db 4,11
+ dw 1060
+ TX_FAR _AlakazamDexEntry
db "@"
-SandslashDexEntry:
- db "MOUSE@"
- db 3,3
- dw 650
- TX_FAR _SandslashDexEntry
+MachopDexEntry:
+ db "SUPERPOWER@"
+ db 2,7
+ dw 430
+ TX_FAR _MachopDexEntry
db "@"
-OmanyteDexEntry:
- db "SPIRAL@"
- db 1,4
- dw 170
- TX_FAR _OmanyteDexEntry
+MachokeDexEntry:
+ db "SUPERPOWER@"
+ db 4,11
+ dw 1550
+ TX_FAR _MachokeDexEntry
db "@"
-OmastarDexEntry:
- db "SPIRAL@"
- db 3,3
- dw 770
- TX_FAR _OmastarDexEntry
+MachampDexEntry:
+ db "SUPERPOWER@"
+ db 5,3
+ dw 2870
+ TX_FAR _MachampDexEntry
db "@"
-JigglypuffDexEntry:
- db "BALLOON@"
- db 1,8
- dw 120
- TX_FAR _JigglypuffDexEntry
+BellsproutDexEntry:
+ db "FLOWER@"
+ db 2,4
+ dw 90
+ TX_FAR _BellsproutDexEntry
db "@"
-WigglytuffDexEntry:
- db "BALLOON@"
+WeepinbellDexEntry:
+ db "FLYCATCHER@"
db 3,3
- dw 260
- TX_FAR _WigglytuffDexEntry
+ dw 140
+ TX_FAR _WeepinbellDexEntry
db "@"
-EeveeDexEntry:
- db "EVOLUTION@"
- db 1,0
- dw 140
- TX_FAR _EeveeDexEntry
+VictreebelDexEntry:
+ db "FLYCATCHER@"
+ db 5,7
+ dw 340
+ TX_FAR _VictreebelDexEntry
db "@"
-FlareonDexEntry:
- db "FLAME@"
+TentacoolDexEntry:
+ db "JELLYFISH@"
db 2,11
- dw 550
- TX_FAR _FlareonDexEntry
+ dw 1000
+ TX_FAR _TentacoolDexEntry
db "@"
-JolteonDexEntry:
- db "LIGHTNING@"
- db 2,7
- dw 540
- TX_FAR _JolteonDexEntry
+TentacruelDexEntry:
+ db "JELLYFISH@"
+ db 5,3
+ dw 1210
+ TX_FAR _TentacruelDexEntry
db "@"
-VaporeonDexEntry:
- db "BUBBLE JET@"
- db 3,3
- dw 640
- TX_FAR _VaporeonDexEntry
+GeodudeDexEntry:
+ db "ROCK@"
+ db 1,4
+ dw 440
+ TX_FAR _GeodudeDexEntry
db "@"
-MachopDexEntry:
- db "SUPERPOWER@"
- db 2,7
- dw 430
- TX_FAR _MachopDexEntry
+GravelerDexEntry:
+ db "ROCK@"
+ db 3,3
+ dw 2320
+ TX_FAR _GravelerDexEntry
db "@"
-ZubatDexEntry:
- db "BAT@"
- db 2,7
- dw 170
- TX_FAR _ZubatDexEntry
+GolemDexEntry:
+ db "MEGATON@"
+ db 4,7
+ dw 6620
+ TX_FAR _GolemDexEntry
db "@"
-EkansDexEntry:
- db "SNAKE@"
- db 6,7
- dw 150
- TX_FAR _EkansDexEntry
+PonytaDexEntry:
+ db "FIRE HORSE@"
+ db 3,3
+ dw 660
+ TX_FAR _PonytaDexEntry
db "@"
-ParasDexEntry:
- db "MUSHROOM@"
- db 1,0
- dw 120
- TX_FAR _ParasDexEntry
+RapidashDexEntry:
+ db "FIRE HORSE@"
+ db 5,7
+ dw 2090
+ TX_FAR _RapidashDexEntry
db "@"
-PoliwhirlDexEntry:
- db "TADPOLE@"
- db 3,3
- dw 440
- TX_FAR _PoliwhirlDexEntry
+SlowpokeDexEntry:
+ db "DOPEY@"
+ db 3,11
+ dw 790
+ TX_FAR _SlowpokeDexEntry
db "@"
-PoliwrathDexEntry:
- db "TADPOLE@"
- db 4,3
- dw 1190
- TX_FAR _PoliwrathDexEntry
+SlowbroDexEntry:
+ db "HERMITCRAB@"
+ db 5,3
+ dw 1730
+ TX_FAR _SlowbroDexEntry
db "@"
-WeedleDexEntry:
- db "HAIRY BUG@"
+MagnemiteDexEntry:
+ db "MAGNET@"
db 1,0
- dw 70
- TX_FAR _WeedleDexEntry
+ dw 130
+ TX_FAR _MagnemiteDexEntry
db "@"
-KakunaDexEntry:
- db "COCOON@"
- db 2,0
- dw 220
- TX_FAR _KakunaDexEntry
+MagnetonDexEntry:
+ db "MAGNET@"
+ db 3,3
+ dw 1320
+ TX_FAR _MagnetonDexEntry
db "@"
-BeedrillDexEntry:
- db "POISON BEE@"
- db 3,3
- dw 650
- TX_FAR _BeedrillDexEntry
+FarfetchdDexEntry:
+ db "WILD DUCK@"
+ db 2,7
+ dw 330
+ TX_FAR _FarfetchdDexEntry
+ db "@"
+
+DoduoDexEntry:
+ db "TWIN BIRD@"
+ db 4,7
+ dw 860
+ TX_FAR _DoduoDexEntry
db "@"
DodrioDexEntry:
@@ -874,25 +790,11 @@ DodrioDexEntry:
TX_FAR _DodrioDexEntry
db "@"
-PrimeapeDexEntry:
- db "PIG MONKEY@"
- db 3,3
- dw 710
- TX_FAR _PrimeapeDexEntry
- db "@"
-
-DugtrioDexEntry:
- db "MOLE@"
- db 2,4
- dw 730
- TX_FAR _DugtrioDexEntry
- db "@"
-
-VenomothDexEntry:
- db "POISONMOTH@"
- db 4,11
- dw 280
- TX_FAR _VenomothDexEntry
+SeelDexEntry:
+ db "SEA LION@"
+ db 3,7
+ dw 1980
+ TX_FAR _SeelDexEntry
db "@"
DewgongDexEntry:
@@ -902,81 +804,81 @@ DewgongDexEntry:
TX_FAR _DewgongDexEntry
db "@"
-CaterpieDexEntry:
- db "WORM@"
- db 1,0
- dw 60
- TX_FAR _CaterpieDexEntry
+GrimerDexEntry:
+ db "SLUDGE@"
+ db 2,11
+ dw 660
+ TX_FAR _GrimerDexEntry
db "@"
-MetapodDexEntry:
- db "COCOON@"
- db 2,4
- dw 220
- TX_FAR _MetapodDexEntry
+MukDexEntry:
+ db "SLUDGE@"
+ db 3,11
+ dw 660
+ TX_FAR _MukDexEntry
db "@"
-ButterfreeDexEntry:
- db "BUTTERFLY@"
- db 3,7
- dw 710
- TX_FAR _ButterfreeDexEntry
+ShellderDexEntry:
+ db "BIVALVE@"
+ db 1,0
+ dw 90
+ TX_FAR _ShellderDexEntry
db "@"
-MachampDexEntry:
- db "SUPERPOWER@"
- db 5,3
- dw 2870
- TX_FAR _MachampDexEntry
+CloysterDexEntry:
+ db "BIVALVE@"
+ db 4,11
+ dw 2920
+ TX_FAR _CloysterDexEntry
db "@"
-GolduckDexEntry:
- db "DUCK@"
- db 5,7
- dw 1690
- TX_FAR _GolduckDexEntry
+GastlyDexEntry:
+ db "GAS@"
+ db 4,3
+ dw 2
+ TX_FAR _GastlyDexEntry
db "@"
-HypnoDexEntry:
- db "HYPNOSIS@"
+HaunterDexEntry:
+ db "GAS@"
db 5,3
- dw 1670
- TX_FAR _HypnoDexEntry
+ dw 2
+ TX_FAR _HaunterDexEntry
db "@"
-GolbatDexEntry:
- db "BAT@"
- db 5,3
- dw 1210
- TX_FAR _GolbatDexEntry
+GengarDexEntry:
+ db "SHADOW@"
+ db 4,11
+ dw 890
+ TX_FAR _GengarDexEntry
db "@"
-MewtwoDexEntry:
- db "GENETIC@"
- db 6,7
- dw 2690
- TX_FAR _MewtwoDexEntry
+OnixDexEntry:
+ db "ROCK SNAKE@"
+ db 28,10
+ dw 4630
+ TX_FAR _OnixDexEntry
db "@"
-SnorlaxDexEntry:
- db "SLEEPING@"
- db 6,11
- dw 10140
- TX_FAR _SnorlaxDexEntry
+DrowzeeDexEntry:
+ db "HYPNOSIS@"
+ db 3,3
+ dw 710
+ TX_FAR _DrowzeeDexEntry
db "@"
-MagikarpDexEntry:
- db "FISH@"
- db 2,11
- dw 220
- TX_FAR _MagikarpDexEntry
+HypnoDexEntry:
+ db "HYPNOSIS@"
+ db 5,3
+ dw 1670
+ TX_FAR _HypnoDexEntry
db "@"
-MukDexEntry:
- db "SLUDGE@"
- db 3,11
- dw 660
- TX_FAR _MukDexEntry
+KrabbyDexEntry:
+ db "RIVER CRAB@"
+ db 1,4
+ dw 140
+ TX_FAR _KrabbyDexEntry
db "@"
KinglerDexEntry:
@@ -986,11 +888,11 @@ KinglerDexEntry:
TX_FAR _KinglerDexEntry
db "@"
-CloysterDexEntry:
- db "BIVALVE@"
- db 4,11
- dw 2920
- TX_FAR _CloysterDexEntry
+VoltorbDexEntry:
+ db "BALL@"
+ db 1,8
+ dw 230
+ TX_FAR _VoltorbDexEntry
db "@"
ElectrodeDexEntry:
@@ -1000,25 +902,25 @@ ElectrodeDexEntry:
TX_FAR _ElectrodeDexEntry
db "@"
-ClefableDexEntry:
- db "FAIRY@"
- db 4,3
- dw 880
- TX_FAR _ClefableDexEntry
+ExeggcuteDexEntry:
+ db "EGG@"
+ db 1,4
+ dw 60
+ TX_FAR _ExeggcuteDexEntry
db "@"
-WeezingDexEntry:
- db "POISON GAS@"
- db 3,11
- dw 210
- TX_FAR _WeezingDexEntry
+ExeggutorDexEntry:
+ db "COCONUT@"
+ db 6,7
+ dw 2650
+ TX_FAR _ExeggutorDexEntry
db "@"
-PersianDexEntry:
- db "CLASSY CAT@"
- db 3,3
- dw 710
- TX_FAR _PersianDexEntry
+CuboneDexEntry:
+ db "LONELY@"
+ db 1,4
+ dw 140
+ TX_FAR _CuboneDexEntry
db "@"
MarowakDexEntry:
@@ -1028,67 +930,88 @@ MarowakDexEntry:
TX_FAR _MarowakDexEntry
db "@"
-HaunterDexEntry:
- db "GAS@"
- db 5,3
- dw 2
- TX_FAR _HaunterDexEntry
+HitmonleeDexEntry:
+ db "KICKING@"
+ db 4,11
+ dw 1100
+ TX_FAR _HitmonleeDexEntry
db "@"
-AbraDexEntry:
- db "PSI@"
- db 2,11
- dw 430
- TX_FAR _AbraDexEntry
+HitmonchanDexEntry:
+ db "PUNCHING@"
+ db 4,7
+ dw 1110
+ TX_FAR _HitmonchanDexEntry
db "@"
-AlakazamDexEntry:
- db "PSI@"
- db 4,11
- dw 1060
- TX_FAR _AlakazamDexEntry
+LickitungDexEntry:
+ db "LICKING@"
+ db 3,11
+ dw 1440
+ TX_FAR _LickitungDexEntry
db "@"
-PidgeottoDexEntry:
- db "BIRD@"
- db 3,7
- dw 660
- TX_FAR _PidgeottoDexEntry
+KoffingDexEntry:
+ db "POISON GAS@"
+ db 2,0
+ dw 20
+ TX_FAR _KoffingDexEntry
db "@"
-PidgeotDexEntry:
- db "BIRD@"
- db 4,11
- dw 870
- TX_FAR _PidgeotDexEntry
+WeezingDexEntry:
+ db "POISON GAS@"
+ db 3,11
+ dw 210
+ TX_FAR _WeezingDexEntry
db "@"
-StarmieDexEntry:
- db "MYSTERIOUS@"
+RhyhornDexEntry:
+ db "SPIKES@"
+ db 3,3
+ dw 2540
+ TX_FAR _RhyhornDexEntry
+ db "@"
+
+RhydonDexEntry:
+ db "DRILL@"
+ db 6,3
+ dw 2650
+ TX_FAR _RhydonDexEntry
+ db "@"
+
+ChanseyDexEntry:
+ db "EGG@"
db 3,7
- dw 1760
- TX_FAR _StarmieDexEntry
+ dw 760
+ TX_FAR _ChanseyDexEntry
db "@"
-BulbasaurDexEntry:
- db "SEED@"
- db 2,4
- dw 150
- TX_FAR _BulbasaurDexEntry
+TangelaDexEntry:
+ db "VINE@"
+ db 3,3
+ dw 770
+ TX_FAR _TangelaDexEntry
db "@"
-VenusaurDexEntry:
- db "SEED@"
- db 6,7
- dw 2210
- TX_FAR _VenusaurDexEntry
+KangaskhanDexEntry:
+ db "PARENT@"
+ db 7,3
+ dw 1760
+ TX_FAR _KangaskhanDexEntry
db "@"
-TentacruelDexEntry:
- db "JELLYFISH@"
- db 5,3
- dw 1210
- TX_FAR _TentacruelDexEntry
+HorseaDexEntry:
+ db "DRAGON@"
+ db 1,4
+ dw 180
+ TX_FAR _HorseaDexEntry
+ db "@"
+
+SeadraDexEntry:
+ db "DRAGON@"
+ db 3,11
+ dw 550
+ TX_FAR _SeadraDexEntry
db "@"
GoldeenDexEntry:
@@ -1105,53 +1028,123 @@ SeakingDexEntry:
TX_FAR _SeakingDexEntry
db "@"
-PonytaDexEntry:
- db "FIRE HORSE@"
- db 3,3
+StaryuDexEntry:
+ db "STARSHAPE@"
+ db 2,7
+ dw 760
+ TX_FAR _StaryuDexEntry
+ db "@"
+
+StarmieDexEntry:
+ db "MYSTERIOUS@"
+ db 3,7
+ dw 1760
+ TX_FAR _StarmieDexEntry
+ db "@"
+
+MrMimeDexEntry:
+ db "BARRIER@"
+ db 4,3
+ dw 1200
+ TX_FAR _MrMimeDexEntry
+ db "@"
+
+ScytherDexEntry:
+ db "MANTIS@"
+ db 4,11
+ dw 1230
+ TX_FAR _ScytherDexEntry
+ db "@"
+
+JynxDexEntry:
+ db "HUMANSHAPE@"
+ db 4,7
+ dw 900
+ TX_FAR _JynxDexEntry
+ db "@"
+
+ElectabuzzDexEntry:
+ db "ELECTRIC@"
+ db 3,7
dw 660
- TX_FAR _PonytaDexEntry
+ TX_FAR _ElectabuzzDexEntry
db "@"
-RapidashDexEntry:
- db "FIRE HORSE@"
- db 5,7
- dw 2090
- TX_FAR _RapidashDexEntry
+MagmarDexEntry:
+ db "SPITFIRE@"
+ db 4,3
+ dw 980
+ TX_FAR _MagmarDexEntry
db "@"
-RattataDexEntry:
- db "RAT@"
- db 1,0
- dw 80
- TX_FAR _RattataDexEntry
+PinsirDexEntry:
+ db "STAGBEETLE@"
+ db 4,11
+ dw 1210
+ TX_FAR _PinsirDexEntry
db "@"
-RaticateDexEntry:
- db "RAT@"
- db 2,4
- dw 410
- TX_FAR _RaticateDexEntry
+TaurosDexEntry:
+ db "WILD BULL@"
+ db 4,7
+ dw 1950
+ TX_FAR _TaurosDexEntry
db "@"
-NidorinoDexEntry:
- db "POISON PIN@"
+MagikarpDexEntry:
+ db "FISH@"
db 2,11
- dw 430
- TX_FAR _NidorinoDexEntry
+ dw 220
+ TX_FAR _MagikarpDexEntry
db "@"
-NidorinaDexEntry:
- db "POISON PIN@"
+GyaradosDexEntry:
+ db "ATROCIOUS@"
+ db 21,4
+ dw 5180
+ TX_FAR _GyaradosDexEntry
+ db "@"
+
+LaprasDexEntry:
+ db "TRANSPORT@"
+ db 8,2
+ dw 4850
+ TX_FAR _LaprasDexEntry
+ db "@"
+
+DittoDexEntry:
+ db "TRANSFORM@"
+ db 1,0
+ dw 90
+ TX_FAR _DittoDexEntry
+ db "@"
+
+EeveeDexEntry:
+ db "EVOLUTION@"
+ db 1,0
+ dw 140
+ TX_FAR _EeveeDexEntry
+ db "@"
+
+VaporeonDexEntry:
+ db "BUBBLE JET@"
+ db 3,3
+ dw 640
+ TX_FAR _VaporeonDexEntry
+ db "@"
+
+JolteonDexEntry:
+ db "LIGHTNING@"
db 2,7
- dw 440
- TX_FAR _NidorinaDexEntry
+ dw 540
+ TX_FAR _JolteonDexEntry
db "@"
-GeodudeDexEntry:
- db "ROCK@"
- db 1,4
- dw 440
- TX_FAR _GeodudeDexEntry
+FlareonDexEntry:
+ db "FLAME@"
+ db 2,11
+ dw 550
+ TX_FAR _FlareonDexEntry
db "@"
PorygonDexEntry:
@@ -1161,95 +1154,102 @@ PorygonDexEntry:
TX_FAR _PorygonDexEntry
db "@"
-AerodactylDexEntry:
- db "FOSSIL@"
- db 5,11
- dw 1300
- TX_FAR _AerodactylDexEntry
+OmanyteDexEntry:
+ db "SPIRAL@"
+ db 1,4
+ dw 170
+ TX_FAR _OmanyteDexEntry
db "@"
-MagnemiteDexEntry:
- db "MAGNET@"
- db 1,0
- dw 130
- TX_FAR _MagnemiteDexEntry
+OmastarDexEntry:
+ db "SPIRAL@"
+ db 3,3
+ dw 770
+ TX_FAR _OmastarDexEntry
db "@"
-CharmanderDexEntry:
- db "LIZARD@"
- db 2,0
- dw 190
- TX_FAR _CharmanderDexEntry
+KabutoDexEntry:
+ db "SHELLFISH@"
+ db 1,8
+ dw 250
+ TX_FAR _KabutoDexEntry
db "@"
-SquirtleDexEntry:
- db "TINYTURTLE@"
- db 1,8
- dw 200
- TX_FAR _SquirtleDexEntry
+KabutopsDexEntry:
+ db "SHELLFISH@"
+ db 4,3
+ dw 890
+ TX_FAR _KabutopsDexEntry
db "@"
-CharmeleonDexEntry:
- db "FLAME@"
- db 3,7
- dw 420
- TX_FAR _CharmeleonDexEntry
+AerodactylDexEntry:
+ db "FOSSIL@"
+ db 5,11
+ dw 1300
+ TX_FAR _AerodactylDexEntry
db "@"
-WartortleDexEntry:
- db "TURTLE@"
- db 3,3
- dw 500
- TX_FAR _WartortleDexEntry
+SnorlaxDexEntry:
+ db "SLEEPING@"
+ db 6,11
+ dw 10140
+ TX_FAR _SnorlaxDexEntry
db "@"
-CharizardDexEntry:
- db "FLAME@"
+ArticunoDexEntry:
+ db "FREEZE@"
db 5,7
- dw 2000
- TX_FAR _CharizardDexEntry
+ dw 1220
+ TX_FAR _ArticunoDexEntry
db "@"
-OddishDexEntry:
- db "WEED@"
- db 1,8
- dw 120
- TX_FAR _OddishDexEntry
+ZapdosDexEntry:
+ db "ELECTRIC@"
+ db 5,3
+ dw 1160
+ TX_FAR _ZapdosDexEntry
db "@"
-GloomDexEntry:
- db "WEED@"
- db 2,7
- dw 190
- TX_FAR _GloomDexEntry
+MoltresDexEntry:
+ db "FLAME@"
+ db 6,7
+ dw 1320
+ TX_FAR _MoltresDexEntry
db "@"
-VileplumeDexEntry:
- db "FLOWER@"
- db 3,11
- dw 410
- TX_FAR _VileplumeDexEntry
+DratiniDexEntry:
+ db "DRAGON@"
+ db 5,11
+ dw 70
+ TX_FAR _DratiniDexEntry
db "@"
-BellsproutDexEntry:
- db "FLOWER@"
- db 2,4
- dw 90
- TX_FAR _BellsproutDexEntry
+DragonairDexEntry:
+ db "DRAGON@"
+ db 13,1
+ dw 360
+ TX_FAR _DragonairDexEntry
db "@"
-WeepinbellDexEntry:
- db "FLYCATCHER@"
- db 3,3
- dw 140
- TX_FAR _WeepinbellDexEntry
+DragoniteDexEntry:
+ db "DRAGON@"
+ db 7,3
+ dw 4630
+ TX_FAR _DragoniteDexEntry
db "@"
-VictreebelDexEntry:
- db "FLYCATCHER@"
- db 5,7
- dw 340
- TX_FAR _VictreebelDexEntry
+MewtwoDexEntry:
+ db "GENETIC@"
+ db 6,7
+ dw 2690
+ TX_FAR _MewtwoDexEntry
+ db "@"
+
+MewDexEntry:
+ db "NEW SPECIE@"
+ db 1,4
+ dw 90
+ TX_FAR _MewDexEntry
db "@"
MissingNoDexEntry:
@@ -1257,3 +1257,9 @@ MissingNoDexEntry:
db 10 ; 1.0 m
db 100 ; 10.0 kg
text "コメント さくせいちゅう@" ; コメント作成中 (Comment to be written)
+
+; what the game sees
+; db "???@"
+; db 10,100 ; 10 feet, 100 inches
+; dw 35072 ; dw ("コ" << 8 | 0), 3507.2 lbs
+; db "メント さくせいちゅう@" ; a whole bunch of sound effects
diff --git a/data/prize_mon_levels.asm b/data/prize_mon_levels.asm
index bffa4440..eb126d37 100755
--- a/data/prize_mon_levels.asm
+++ b/data/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 SCYTHER,30
+ db PINSIR,30
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
diff --git a/data/prizes.asm b/data/prizes.asm
index 1120c0d0..b113c7cb 100755
--- a/data/prizes.asm
+++ b/data/prizes.asm
@@ -8,55 +8,28 @@ PrizeDifferentMenuPtrs:
dw PrizeMenuTMsEntries
dw 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)
- coins 180
- coins 500
-ENDC
-IF DEF(_BLUE)
- coins 120
- coins 750
-ENDC
- coins 1200
+ coins 230
+ coins 1000
+ coins 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)
- coins 2800
- coins 5500
- coins 9999
-ENDC
-IF DEF(_BLUE)
- coins 2500
- coins 4600
coins 6500
-ENDC
+ coins 6500
+ coins 9999
db "@"
PrizeMenuTMsEntries:
diff --git a/data/sgb_border.asm b/data/sgb_border.asm
index c2afc193..cc592487 100755
--- a/data/sgb_border.asm
+++ b/data/sgb_border.asm
@@ -1,62 +1,87 @@
BorderPalettes:
-IF DEF(_RED)
- INCBIN "gfx/red/sgbborder.map"
-ENDC
-IF DEF(_BLUE)
- INCBIN "gfx/blue/sgbborder.map"
-ENDC
+ INCBIN "gfx/tilemaps/sgbborder.map"
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/red/sgbborder.2bpp"
-ENDC
-IF DEF(_BLUE)
- INCBIN "gfx/blue/sgbborder.2bpp"
-ENDC
+ INCBIN "gfx/pokemon_yellow.2bpp"
diff --git a/data/sgb_packets.asm b/data/sgb_packets.asm
index cae91883..b188ad42 100755
--- a/data/sgb_packets.asm
+++ b/data/sgb_packets.asm
@@ -56,8 +56,6 @@ BlkPacket_WholeScreen:
ATTR_BLK_DATA %011, 0,0,0, 00,00, 19,17
ds 8
- db $03,$00,$00,$13,$11,$00,$00
-
BlkPacket_Battle:
ATTR_BLK 5
ATTR_BLK_DATA %111, 2,2,0, 00,12, 19,17 ; message box: pal 2
@@ -66,35 +64,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
- db $03,$00,$00,$13,$0b,$00
- db $03,$00,$0c,$13,$11,$02
- db $03,$01,$00,$0a,$03,$01
- db $03,$0a,$08,$13,$0a,$00
- db $03,$00,$04,$08,$0b,$02
- db $03,$0b,$00,$13,$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
- db $02,$00,$00,$11,$00,$03
- db $01,$00,$07,$06,$01,$03
- db $01,$07,$13,$11,$00,$03
- db $08,$00,$13,$06,$00,$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
- db $02,$00,$00,$11,$00,$01
- db $00,$01,$13,$00,$03,$01
- db $01,$08,$08,$01,$03,$01
- db $09,$08,$11,$00,$03,$09
- db $01,$13,$11,$00,$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
@@ -103,25 +82,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
- db $03,$00,$00,$13,$0b,$01
- db $03,$00,$04,$13,$09,$02
- db $03,$00,$06,$13,$07,$03
- db $03,$04,$04,$0f,$09,$00
- db $03,$00,$0c,$13,$11,$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
+ ATTR_BLK_DATA %011, 2,2,0, 00,08, 19,17
+ ATTR_BLK_DATA %010, 0,0,0, 09,08, 10,08
ds 12
- db $03,$00,$00,$13,$07,$00
- db $03,$00,$08,$13,$09,$01
- db $03,$00,$0a,$13,$11,$02
- db $00
-
BlkPacket_NidorinoIntro:
ATTR_BLK 3
ATTR_BLK_DATA %011, 1,1,0, 00,00, 19,03 ; upper black bar: pal 1
@@ -129,11 +96,6 @@ BlkPacket_NidorinoIntro:
ATTR_BLK_DATA %011, 1,1,0, 00,14, 19,17 ; lower black bar: pal 1
ds 12
- db $03,$00,$00,$13,$03,$01
- db $03,$00,$04,$13,$0d,$00
- db $03,$00,$0e,$13,$11,$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
@@ -145,43 +107,20 @@ BlkPacket_PartyMenu:
ATTR_BLK_DATA %010, 0,0,0, 05,11, 11,11 ; HP bar 5: pal set dynamically
ds 4
- db $02,$00,$00,$11,$01,$03
- db $01,$00,$02,$0c,$00,$03
- db $01,$0d,$02,$11,$01,$03
- db $03,$00,$13,$11,$01,$03
- db $0c,$00,$12,$01,$00,$03
- db $0c,$02,$12,$03,$00,$03
- db $0c,$04,$12,$05,$00,$03
- db $0c,$06,$12,$07,$00,$03
- db $0c,$08,$12,$09,$00,$03
- db $0c,$0a,$12,$0b,$00,$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, 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
+ ATTR_BLK_DATA %010, 0,0,0, 03,12, 04,13
+ ATTR_BLK_DATA %010, 1,1,0, 07,12, 08,13
+ ATTR_BLK_DATA %010, 3,3,0, 11,12, 12,13
+ ATTR_BLK_DATA %010, 2,2,0, 16,11, 17,12
+ ATTR_BLK_DATA %010, 1,1,0, 14,13, 15,13
+ ATTR_BLK_DATA %010, 3,3,0, 16,13, 17,13
+ ATTR_BLK_DATA %010, 2,2,0, 03,15, 04,16
+ ATTR_BLK_DATA %010, 3,3,0, 07,15, 08,16
+ ATTR_BLK_DATA %010, 2,2,0, 11,15, 12,16
+ ATTR_BLK_DATA %010, 1,1,0, 15,15, 16,16
ds 2
- db $03,$03,$0c,$04,$0d,$00
- db $03,$07,$0c,$08,$0d,$01
- db $03,$0b,$0c,$0c,$0d,$03
- db $03,$10,$0b,$11,$0c,$02
- db $03,$0e,$0d,$0f,$0e,$01
- db $03,$10,$0d,$11,$0e,$03
- db $03,$03,$0f,$04,$10,$02
- db $03,$07,$0f,$08,$10,$03
- db $03,$0b,$0f,$0c,$10,$02
- db $03,$0f,$0f,$10,$10,$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
@@ -189,15 +128,10 @@ BlkPacket_GameFreakIntro:
ATTR_BLK_DATA %011, 3,3,0, 12,11, 14,13 ; falling stars (right): pal 3
ds 12
- db $03,$00,$00,$13,$0a,$00
- db $03,$00,$0b,$04,$0d,$00
- db $03,$05,$0b,$07,$0d,$01
- db $03,$08,$0b,$13,$0d,$00
- db $03,$00,$0e,$13,$11,$00
- db $03,$08,$0b,$09,$0d,$02
- db $03,$0c,$0b,$0e,$0d,$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
PalPacket_PartyMenu: PAL_SET PAL_MEWMON, PAL_GREENBAR, PAL_YELLOWBAR, PAL_REDBAR
@@ -210,6 +144,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
@@ -220,18 +156,17 @@ PctTrnPacket: PCT_TRN
MaskEnFreezePacket: MASK_EN 1
MaskEnCancelPacket: MASK_EN 0
-
; These are DATA_SND packets containing SNES code.
; This set of packets is found in several Japanese SGB-compatible titles.
; It appears to be part of NCL's SGB devkit.
-DataSnd_72548: DATA_SND $85d, $0, 11
+DataSnd_728a1: DATA_SND $85d, $0, 11
db $8C ; cpx #$8c (2)
db $D0, $F4 ; bne -$0c
db $60 ; rts
ds 7
-DataSnd_72558: DATA_SND $852, $0, 11
+DataSnd_728b1: DATA_SND $852, $0, 11
db $A9, $E7 ; lda #$e7
db $9F, $01, $C0, $7E ; sta $7ec001, x
db $E8 ; inx
@@ -240,7 +175,7 @@ DataSnd_72558: DATA_SND $852, $0, 11
db $E8 ; inx
db $E0 ; cpx #$8c (1)
-DataSnd_72568: DATA_SND $847, $0, 11
+DataSnd_728c1: DATA_SND $847, $0, 11 ; 728c1 (1c:68c1)
db $C4 ; cmp #$c4 (2)
db $D0, $16 ; bne +$16
db $A5 ; lda dp
@@ -249,7 +184,7 @@ DataSnd_72568: DATA_SND $847, $0, 11
db $D0, $10 ; bne +$10
db $A2, $28 ; ldx #$28
-DataSnd_72578: DATA_SND $83c, $0, 11
+DataSnd_728d1: DATA_SND $83c, $0, 11 ; 728d1 (1c:68d1)
db $F0, $12 ; beq +$12
db $A5 ; lda dp
db $C9, $C9 ; cmp #$c9
@@ -259,7 +194,7 @@ DataSnd_72578: DATA_SND $83c, $0, 11
db $CA ; dex
db $C9 ; cmp #$c4 (1)
-DataSnd_72588: DATA_SND $831, $0, 11
+DataSnd_728e1: DATA_SND $831, $0, 11
dbw $0C, $CAA5 ; tsb $caa5
db $C9, $7E ; cmp #$7e
db $D0, $06 ; bne +$06
@@ -267,7 +202,7 @@ DataSnd_72588: DATA_SND $831, $0, 11
db $CB ; wai
db $C9, $7E ; cmp #$7e
-DataSnd_72598: DATA_SND $826, $0, 11
+DataSnd_728f1: DATA_SND $826, $0, 11
db $39 ; bne +$39 (2)
dbw $CD, $C48 ; cmp $c48
db $D0, $34 ; bne +$34
@@ -275,7 +210,7 @@ DataSnd_72598: DATA_SND $826, $0, 11
db $C9, $C9 ; cmp #$c9
db $80, $D0 ; bra -$30
-DataSnd_725a8: DATA_SND $81b, $0, 11
+DataSnd_72901: DATA_SND $81b, $0, 11
db $EA ; nop
db $EA ; nop
db $EA ; nop
@@ -286,7 +221,7 @@ DataSnd_725a8: DATA_SND $81b, $0, 11
dbw $CD,$C4F ; cmp $c4f
db $D0 ; bne +$39 (1)
-DataSnd_725b8: DATA_SND $810, $0, 11
+DataSnd_72911: DATA_SND $810, $0, 11
dbw $4C, $820 ; jmp $820
db $EA ; nop
db $EA ; nop
diff --git a/data/sprite_sets.asm b/data/sprite_sets.asm
index 5b0e1e00..d74c9d2f 100755
--- a/data/sprite_sets.asm
+++ b/data/sprite_sets.asm
@@ -60,32 +60,33 @@ SplitMapSpriteSets:
SpriteSets:
; sprite set $01
+ db SPRITE_PIKACHU
db SPRITE_BLUE
db SPRITE_BUG_CATCHER
db SPRITE_GIRL
db SPRITE_FISHER2
db SPRITE_BLACK_HAIR_BOY_1
db SPRITE_GAMBLER
- db SPRITE_SEEL
db SPRITE_OAK
db SPRITE_SWIMMER
db SPRITE_BALL
db SPRITE_LYING_OLD_MAN
; sprite set $02
+ db SPRITE_PIKACHU
db SPRITE_BUG_CATCHER
db SPRITE_ROCKET
db SPRITE_BLACK_HAIR_BOY_2
db SPRITE_HIKER
- db SPRITE_SLOWBRO
db SPRITE_BLUE
- db SPRITE_GUARD
+ db SPRITE_OFFICER_JENNY
db SPRITE_LASS
db SPRITE_BLACK_HAIR_BOY_1
db SPRITE_BALL
db SPRITE_LYING_OLD_MAN_UNUSED_2
; sprite set $03
+ db SPRITE_PIKACHU
db SPRITE_LITTLE_GIRL
db SPRITE_GIRL
db SPRITE_BLACK_HAIR_BOY_2
@@ -94,17 +95,16 @@ SpriteSets:
db SPRITE_SLOWBRO
db SPRITE_LASS
db SPRITE_BLACK_HAIR_BOY_1
- db SPRITE_GUARD
db SPRITE_BALL
db SPRITE_LYING_OLD_MAN_UNUSED_2
; sprite set $04
- db SPRITE_FOULARD_WOMAN
+ db SPRITE_PIKACHU
+ db SPRITE_OFFICER_JENNY
db SPRITE_BLACK_HAIR_BOY_2
db SPRITE_BUG_CATCHER
db SPRITE_GAMBLER
db SPRITE_SLOWBRO
- db SPRITE_GUARD
db SPRITE_SAILOR
db SPRITE_LASS
db SPRITE_BLACK_HAIR_BOY_1
@@ -112,6 +112,7 @@ SpriteSets:
db SPRITE_LYING_OLD_MAN_UNUSED_2
; sprite set $05
+ db SPRITE_PIKACHU
db SPRITE_LITTLE_GIRL
db SPRITE_YOUNG_BOY
db SPRITE_GIRL
@@ -119,13 +120,12 @@ SpriteSets:
db SPRITE_FAT_BALD_GUY
db SPRITE_OLD_PERSON
db SPRITE_SLOWBRO
- db SPRITE_GUARD
db SPRITE_ROCKET
db SPRITE_BALL
db SPRITE_SNORLAX
; sprite set $06
- db SPRITE_BUG_CATCHER
+ db SPRITE_PIKACHU
db SPRITE_GYM_HELPER
db SPRITE_SLOWBRO
db SPRITE_BLUE
@@ -138,6 +138,7 @@ SpriteSets:
db SPRITE_LYING_OLD_MAN_UNUSED_2
; sprite set $07
+ db SPRITE_PIKACHU
db SPRITE_ROCKET
db SPRITE_OAK_AIDE
db SPRITE_LAPRAS_GIVER
@@ -146,11 +147,11 @@ SpriteSets:
db SPRITE_BIRD
db SPRITE_ROCKER
db SPRITE_BLACK_HAIR_BOY_1
- db SPRITE_SLOWBRO
db SPRITE_BALL
db SPRITE_LYING_OLD_MAN_UNUSED_2
; sprite set $08
+ db SPRITE_PIKACHU
db SPRITE_BIKER
db SPRITE_BLACK_HAIR_BOY_2
db SPRITE_FAT_BALD_GUY
@@ -159,11 +160,11 @@ SpriteSets:
db SPRITE_FOULARD_WOMAN
db SPRITE_FISHER2
db SPRITE_ROCKER
- db SPRITE_SLOWBRO
db SPRITE_BALL
db SPRITE_SNORLAX
; sprite set $09
+ db SPRITE_PIKACHU
db SPRITE_BIKER
db SPRITE_BLACK_HAIR_BOY_1
db SPRITE_LAPRAS_GIVER
@@ -172,14 +173,13 @@ SpriteSets:
db SPRITE_HIKER
db SPRITE_GAMBLER
db SPRITE_FAT_BALD_GUY
- db SPRITE_BLACK_HAIR_BOY_2
db SPRITE_BALL
db SPRITE_SNORLAX
; sprite set $0a
- db SPRITE_BIRD
+ db SPRITE_PIKACHU
db SPRITE_BLACK_HAIR_BOY_1
- db SPRITE_CLEFAIRY
+ db SPRITE_CHANSEY
db SPRITE_FISHER2
db SPRITE_GAMBLER
db SPRITE_SLOWBRO
@@ -340,10 +340,10 @@ SpriteSheetPointerTable:
db $c0 ; byte count
db BANK(LanceSprite)
- ; SPRITE_OAK_SCIENTIST_AIDE
- dw OakAideSprite
+ ; SPRITE_UNUSED_1
+ dw RedSprite
db $c0 ; byte count
- db BANK(OakAideSprite)
+ db BANK(RedSprite)
; SPRITE_OAK_AIDE
dw OakAideSprite
@@ -435,10 +435,10 @@ SpriteSheetPointerTable:
db $c0 ; byte count
db BANK(GuardSprite)
- ; $32
- dw GuardSprite
+ ; SPRITE_UNUSED_2
+ dw RedSprite
db $c0 ; byte count
- db BANK(GuardSprite)
+ db BANK(RedSprite)
; SPRITE_MOM
dw MomSprite
@@ -455,12 +455,12 @@ SpriteSheetPointerTable:
db $c0 ; byte count
db BANK(YoungBoySprite)
- ; SPRITE_GAMEBOY_KID
- dw GameboyKidSprite
+ ; SPRITE_UNUSED_3
+ dw RedSprite
db $c0 ; byte count
- db BANK(GameboyKidSprite)
+ db BANK(RedSprite)
- ; SPRITE_GAMEBOY_KID_COPY
+ ; SPRITE_GAMEBOY_KID
dw GameboyKidSprite
db $c0 ; byte count
db BANK(GameboyKidSprite)
@@ -490,6 +490,56 @@ SpriteSheetPointerTable:
db $c0 ; byte count
db BANK(SeelSprite)
+ ; SPRITE_PIKACHU
+ dw PikachuSprite
+ db $c0
+ db BANK(PikachuSprite)
+
+ ; SPRITE_OFFICER_JENNY
+ dw OfficerJennySprite
+ db $c0
+ db BANK(OfficerJennySprite)
+
+ ; SPRITE_SANDSHREW
+ dw SandshrewSprite
+ db $c0
+ db BANK(SandshrewSprite)
+
+ ; SPRITE_ODDISH
+ dw OddishSprite
+ db $c0
+ db BANK(OddishSprite)
+
+ ; SPRITE_BULBASAUR
+ dw BulbasaurSprite
+ db $c0
+ db BANK(BulbasaurSprite)
+
+ ; SPRITE_JIGGLYPUFF
+ dw JigglypuffSprite
+ db $c0
+ db BANK(JigglypuffSprite)
+
+ ; SPRITE_CLEFAIRY_2
+ dw Clefairy2Sprite
+ db $c0
+ db BANK(Clefairy2Sprite)
+
+ ; SPRITE_CHANSEY
+ dw ChanseySprite
+ db $c0
+ db BANK(ChanseySprite)
+
+ ; SPRITE_JESSIE
+ dw JessieSprite
+ db $c0
+ db BANK(JessieSprite)
+
+ ; SPRITE_JAMES
+ dw JamesSprite
+ db $c0
+ db BANK(JamesSprite)
+
; SPRITE_BALL
dw BallSprite
db $40 ; byte count
diff --git a/data/super_palettes.asm b/data/super_palettes.asm
index 97f1d8ec..d04d461e 100755
--- a/data/super_palettes.asm
+++ b/data/super_palettes.asm
@@ -1,174 +1,481 @@
-; palettes for overworlds, title screen, monsters
SuperPalettes:
- RGB 31,29,31 ; PAL_ROUTE
- RGB 21,28,11
- RGB 20,26,31
- RGB 3,2,2
- RGB 31,29,31 ; PAL_PALLET
- RGB 25,28,27
- RGB 20,26,31
- RGB 3,2,2
- RGB 31,29,31 ; PAL_VIRIDIAN
- RGB 17,26,3
- RGB 20,26,31
- RGB 3,2,2
- RGB 31,29,31 ; PAL_PEWTER
- RGB 23,25,16
- RGB 20,26,31
- RGB 3,2,2
- RGB 31,29,31 ; PAL_CERULEAN
- RGB 17,20,30
- RGB 20,26,31
- RGB 3,2,2
- RGB 31,29,31 ; PAL_LAVENDER
- RGB 27,20,27
- RGB 20,26,31
- RGB 3,2,2
- RGB 31,29,31 ; PAL_VERMILION
- RGB 30,18,0
- RGB 20,26,31
- RGB 3,2,2
- RGB 31,29,31 ; PAL_CELADON
- RGB 16,30,22
- RGB 20,26,31
- RGB 3,2,2
- RGB 31,29,31 ; PAL_FUCHSIA
- RGB 31,15,22
- RGB 20,26,31
- RGB 3,2,2
- RGB 31,29,31 ; PAL_CINNABAR
- RGB 26,10,6
- RGB 20,26,31
- RGB 3,2,2
- RGB 31,29,31 ; PAL_INDIGO
- RGB 22,14,24
- RGB 20,26,31
- RGB 3,2,2
- RGB 31,29,31 ; PAL_SAFFRON
- RGB 27,27,3
- RGB 20,26,31
- RGB 3,2,2
- RGB 31,29,31 ; PAL_TOWNMAP
- RGB 20,26,31
- RGB 17,23,10
- RGB 3,2,2
-IF DEF(_RED)
- RGB 31,29,31 ; PAL_LOGO1
- RGB 30,30,17
- RGB 17,23,10
- RGB 21,0,4
-ENDC
-IF DEF(_BLUE)
- RGB 31,29,31 ; PAL_LOGO1
- RGB 30,30,17
- RGB 21,0,4
- RGB 14,19,29
-ENDC
- RGB 31,29,31 ; PAL_LOGO2
- RGB 30,30,17
- RGB 18,18,24
- RGB 7,7,16
- RGB 31,29,31 ; PAL_0F
- RGB 24,20,30
- RGB 11,20,30
- RGB 3,2,2
- RGB 31,29,31 ; PAL_MEWMON
- RGB 30,22,17
- RGB 16,14,19
- RGB 3,2,2
- RGB 31,29,31 ; PAL_BLUEMON
- RGB 18,20,27
- RGB 11,15,23
- RGB 3,2,2
- RGB 31,29,31 ; PAL_REDMON
- RGB 31,20,10
- RGB 26,10,6
- RGB 3,2,2
- RGB 31,29,31 ; PAL_CYANMON
- RGB 21,25,29
- RGB 14,19,25
- RGB 3,2,2
- RGB 31,29,31 ; PAL_PURPLEMON
- RGB 27,22,24
- RGB 21,15,23
- RGB 3,2,2
- RGB 31,29,31 ; PAL_BROWNMON
- RGB 28,20,15
- RGB 21,14,9
- RGB 3,2,2
- RGB 31,29,31 ; PAL_GREENMON
- RGB 20,26,16
- RGB 9,20,11
- RGB 3,2,2
- RGB 31,29,31 ; PAL_PINKMON
- RGB 30,22,24
- RGB 28,15,21
- RGB 3,2,2
- RGB 31,29,31 ; PAL_YELLOWMON
- RGB 31,28,14
- RGB 26,20,0
- RGB 3,2,2
- RGB 31,29,31 ; PAL_GREYMON
- RGB 26,21,22
- RGB 15,15,18
- RGB 3,2,2
- RGB 31,29,31 ; PAL_SLOTS1
- RGB 26,21,22
- RGB 27,20,6
- RGB 3,2,2
- RGB 31,29,31 ; PAL_SLOTS2
- RGB 31,31,17
-IF DEF(_RED)
- RGB 25,17,21
-ENDC
-IF DEF(_BLUE)
- RGB 16,19,29
-ENDC
- RGB 3,2,2
- RGB 31,29,31 ; PAL_SLOTS3
- RGB 22,31,16
-IF DEF(_RED)
- RGB 25,17,21
-ENDC
-IF DEF(_BLUE)
- RGB 16,19,29
-ENDC
- RGB 3,2,2
- RGB 31,29,31 ; PAL_SLOTS4
-IF DEF(_RED)
- RGB 16,19,29
- RGB 25,17,21
-ENDC
-IF DEF(_BLUE)
- RGB 25,17,21
- RGB 16,19,29
-ENDC
- RGB 3,2,2
- RGB 31,29,31 ; PAL_BLACK
- RGB 7,7,7
- RGB 2,3,3
- RGB 3,2,2
- RGB 31,29,31 ; PAL_GREENBAR
- RGB 30,26,15
- RGB 9,20,11
- RGB 3,2,2
- RGB 31,29,31 ; PAL_YELLOWBAR
- RGB 30,26,15
- RGB 26,20,0
- RGB 3,2,2
- RGB 31,29,31 ; PAL_REDBAR
- RGB 30,26,15
- RGB 26,10,6
- RGB 3,2,2
- RGB 31,29,31 ; PAL_BADGE
- RGB 30,22,17
- RGB 11,15,23
- RGB 3,2,2
- RGB 31,29,31 ; PAL_CAVE
- RGB 21,14,9
- RGB 18,24,22
- RGB 3,2,2
- RGB 31,29,31 ; PAL_GAMEFREAK
- RGB 31,28,14
- RGB 24,20,10
- RGB 3,2,2
+ ; PAL_ROUTE
+ RGB 31, 31, 30
+ RGB 23, 26, 19
+ RGB 23, 27, 31
+ RGB 6, 6, 6
+
+ ; PAL_PALLET
+ RGB 31, 31, 30
+ RGB 28, 27, 31
+ RGB 23, 27, 31
+ RGB 6, 6, 6
+
+ ; PAL_VIRIDIAN
+ RGB 31, 31, 30
+ RGB 26, 31, 21
+ RGB 23, 27, 31
+ RGB 6, 6, 6
+
+ ; PAL_PEWTER
+ RGB 31, 31, 30
+ RGB 23, 23, 22
+ RGB 23, 27, 31
+ RGB 6, 6, 6
+
+ ; PAL_CERULEAN
+ RGB 31, 31, 30
+ RGB 22, 23, 31
+ RGB 23, 27, 31
+ RGB 6, 6, 6
+
+ ; PAL_LAVENDER
+ RGB 31, 31, 30
+ RGB 27, 23, 29
+ RGB 23, 27, 31
+ RGB 6, 6, 6
+
+ ; PAL_VERMILION
+ RGB 31, 31, 30
+ RGB 31, 25, 16
+ RGB 23, 27, 31
+ RGB 6, 6, 6
+
+ ; PAL_CELADON
+ RGB 31, 31, 30
+ RGB 22, 31, 22
+ RGB 23, 27, 31
+ RGB 6, 6, 6
+
+ ; PAL_FUCHSIA
+ RGB 31, 31, 30
+ RGB 31, 26, 26
+ RGB 23, 27, 31
+ RGB 6, 6, 6
+
+ ; PAL_CINNABAR
+ RGB 31, 31, 30
+ RGB 31, 15, 14
+ RGB 23, 27, 31
+ RGB 6, 6, 6
+
+ ; PAL_INDIGO
+ RGB 31, 31, 30
+ RGB 17, 17, 25
+ RGB 23, 27, 31
+ RGB 6, 6, 6
+
+ ; PAL_SAFFRON
+ RGB 31, 31, 30
+ RGB 31, 31, 19
+ RGB 23, 27, 31
+ RGB 6, 6, 6
+
+ ; PAL_TOWNMAP
+ RGB 31, 31, 30
+ RGB 20, 26, 31
+ RGB 17, 23, 10
+ RGB 3, 2, 2
+
+ ; PAL_LOGO1
+ RGB 31, 31, 30
+ RGB 30, 30, 17
+ RGB 21, 0, 4
+ RGB 21, 0, 4
+
+ ; PAL_LOGO2
+ RGB 31, 31, 30
+ RGB 30, 30, 17
+ RGB 18, 18, 24
+ RGB 7, 7, 16
+
+ ; PAL_0F
+ RGB 31, 31, 30
+ RGB 24, 20, 30
+ RGB 11, 20, 30
+ RGB 3, 2, 2
+
+ ; PAL_MEWMON
+ RGB 31, 31, 30
+ RGB 31, 30, 22
+ RGB 27, 16, 16
+ RGB 6, 6, 6
+
+ ; PAL_BLUEMON
+ RGB 31, 31, 30
+ RGB 21, 22, 31
+ RGB 9, 10, 20
+ RGB 6, 6, 6
+
+ ; PAL_REDMON
+ RGB 31, 31, 30
+ RGB 31, 24, 11
+ RGB 26, 9, 6
+ RGB 6, 6, 6
+
+ ; PAL_CYANMON
+ RGB 31, 31, 30
+ RGB 26, 28, 31
+ RGB 7, 24, 28
+ RGB 6, 6, 6
+
+ ; PAL_PURPLEMON
+ RGB 31, 31, 30
+ RGB 27, 22, 30
+ RGB 22, 15, 23
+ RGB 6, 6, 6
+
+ ; PAL_BROWNMON
+ RGB 31, 31, 30
+ RGB 26, 23, 18
+ RGB 18, 14, 10
+ RGB 6, 6, 6
+
+ ; PAL_GREENMON
+ RGB 31, 31, 30
+ RGB 24, 28, 18
+ RGB 13, 21, 15
+ RGB 6, 6, 6
+
+ ; PAL_PINKMON
+ RGB 31, 31, 30
+ RGB 31, 24, 26
+ RGB 31, 18, 21
+ RGB 6, 6, 6
+
+ ; PAL_YELLOWMON
+ RGB 31, 31, 30
+ RGB 31, 31, 19
+ RGB 28, 23, 9
+ RGB 6, 6, 6
+
+ ; PAL_GREYMON
+ RGB 31, 31, 30
+ RGB 25, 25, 18
+ RGB 16, 16, 14
+ RGB 6, 6, 6
+
+ ; PAL_SLOTS1
+ RGB 31, 31, 30
+ RGB 27, 22, 30
+ RGB 26, 9, 6
+ RGB 6, 6, 6
+
+ ; PAL_SLOTS2
+ RGB 31, 31, 30
+ RGB 31, 23, 26
+ RGB 29, 29, 8
+ RGB 6, 6, 6
+
+ ; PAL_SLOTS3
+ RGB 31, 31, 30
+ RGB 23, 31, 20
+ RGB 29, 29, 8
+ RGB 6, 6, 6
+
+ ; PAL_SLOTS4
+ RGB 31, 31, 30
+ RGB 23, 29, 31
+ RGB 29, 29, 8
+ RGB 6, 6, 6
+
+ ; PAL_BLACK
+ RGB 31, 31, 30
+ RGB 6, 6, 6
+ RGB 6, 6, 6
+ RGB 6, 6, 6
+
+ ; PAL_GREENBAR
+ RGB 31, 31, 30
+ RGB 31, 31, 19
+ RGB 0, 21, 0
+ RGB 6, 6, 6
+
+ ; PAL_YELLOWBAR
+ RGB 31, 31, 30
+ RGB 31, 31, 19
+ RGB 28, 23, 9
+ RGB 6, 6, 6
+
+ ; PAL_REDBAR
+ RGB 31, 31, 30
+ RGB 31, 31, 19
+ RGB 26, 9, 6
+ RGB 6, 6, 6
+
+ ; PAL_BADGE
+ RGB 31, 31, 30
+ RGB 20, 15, 11
+ RGB 22, 21, 20
+ RGB 6, 6, 6
+
+ ; PAL_CAVE
+ RGB 31, 31, 30
+ RGB 20, 15, 11
+ RGB 22, 21, 20
+ RGB 6, 6, 6
+
+ ; PAL_GAMEFREAK
+ RGB 31, 31, 30
+ RGB 28, 24, 14
+ RGB 20, 20, 11
+ RGB 6, 6, 6
+
+ ; PAL_25
+ RGB 31, 31, 30
+ RGB 31, 30, 22
+ RGB 23, 27, 31
+ RGB 6, 6, 6
+
+ ; PAL_26
+ RGB 31, 31, 30
+ RGB 28, 23, 9
+ RGB 18, 14, 10
+ RGB 6, 6, 6
+
+ ; PAL_27
+ RGB 31, 31, 30
+ RGB 16, 16, 16
+ RGB 31, 25, 9
+ RGB 6, 6, 6
+
+GBCBasePalettes:
+ ; PAL_ROUTE
+ RGB 31, 31, 31
+ RGB 16, 31, 4
+ RGB 11, 23, 31
+ RGB 3, 3, 3
+
+ ; PAL_PALLET
+ RGB 31, 31, 31
+ RGB 23, 17, 31
+ RGB 11, 23, 31
+ RGB 3, 3, 3
+
+ ; PAL_VIRIDIAN
+ RGB 31, 31, 31
+ RGB 19, 31, 0
+ RGB 11, 23, 31
+ RGB 3, 3, 3
+
+ ; PAL_PEWTER
+ RGB 31, 31, 31
+ RGB 18, 18, 15
+ RGB 11, 23, 31
+ RGB 3, 3, 3
+
+ ; PAL_CERULEAN
+ RGB 31, 31, 31
+ RGB 5, 8, 31
+ RGB 11, 23, 31
+ RGB 3, 3, 3
+
+ ; PAL_LAVENDER
+ RGB 31, 31, 31
+ RGB 25, 4, 31
+ RGB 11, 23, 31
+ RGB 3, 3, 3
+
+ ; PAL_VERMILION
+ RGB 31, 31, 31
+ RGB 31, 19, 0
+ RGB 11, 23, 31
+ RGB 3, 3, 3
+
+ ; PAL_CELADON
+ RGB 31, 31, 31
+ RGB 5, 31, 5
+ RGB 11, 23, 31
+ RGB 3, 3, 3
+
+ ; PAL_FUCHSIA
+ RGB 31, 31, 31
+ RGB 31, 15, 15
+ RGB 11, 23, 31
+ RGB 3, 3, 3
+
+ ; PAL_CINNABAR
+ RGB 31, 31, 31
+ RGB 31, 8, 8
+ RGB 11, 23, 31
+ RGB 3, 3, 3
+
+ ; PAL_INDIGO
+ RGB 31, 31, 31
+ RGB 11, 8, 31
+ RGB 11, 23, 31
+ RGB 3, 3, 3
+
+ ; PAL_SAFFRON
+ RGB 31, 31, 31
+ RGB 31, 31, 0
+ RGB 11, 23, 31
+ RGB 3, 3, 3
+
+ ; PAL_TOWNMAP
+ RGB 31, 31, 31
+ RGB 0, 21, 31
+ RGB 10, 28, 0
+ RGB 1, 1, 1
+
+ ; PAL_LOGO1
+ RGB 31, 31, 31
+ RGB 31, 31, 0
+ RGB 31, 0, 0
+ RGB 31, 0, 0
+
+ ; PAL_LOGO2
+ RGB 31, 31, 31
+ RGB 31, 31, 0
+ RGB 7, 7, 25
+ RGB 0, 0, 17
+
+ ; PAL_0F
+ RGB 31, 31, 31
+ RGB 13, 1, 31
+ RGB 0, 9, 31
+ RGB 1, 1, 1
+
+ ; PAL_MEWMON
+ RGB 31, 31, 31
+ RGB 31, 31, 0
+ RGB 31, 1, 1
+ RGB 3, 3, 3
+
+ ; PAL_BLUEMON
+ RGB 31, 31, 31
+ RGB 16, 18, 31
+ RGB 0, 1, 25
+ RGB 3, 3, 3
+
+ ; PAL_REDMON
+ RGB 31, 31, 31
+ RGB 31, 17, 0
+ RGB 31, 0, 0
+ RGB 3, 3, 3
+
+ ; PAL_CYANMON
+ RGB 31, 31, 31
+ RGB 16, 26, 31
+ RGB 0, 17, 31
+ RGB 3, 3, 3
+
+ ; PAL_PURPLEMON
+ RGB 31, 31, 31
+ RGB 25, 15, 31
+ RGB 19, 0, 22
+ RGB 3, 3, 3
+
+ ; PAL_BROWNMON
+ RGB 31, 31, 31
+ RGB 29, 18, 10
+ RGB 17, 9, 5
+ RGB 3, 3, 3
+
+ ; PAL_GREENMON
+ RGB 31, 31, 31
+ RGB 17, 31, 11
+ RGB 1, 22, 6
+ RGB 3, 3, 3
+
+ ; PAL_PINKMON
+ RGB 31, 31, 31
+ RGB 31, 15, 18
+ RGB 31, 0, 6
+ RGB 3, 3, 3
+
+ ; PAL_YELLOWMON
+ RGB 31, 31, 31
+ RGB 31, 31, 0
+ RGB 28, 14, 0
+ RGB 3, 3, 3
+
+ ; PAL_GREYMON
+ RGB 31, 31, 31
+ RGB 20, 23, 10
+ RGB 11, 11, 5
+ RGB 3, 3, 3
+
+ ; PAL_SLOTS1
+ RGB 31, 31, 31
+ RGB 25, 1, 31
+ RGB 31, 0, 0
+ RGB 3, 3, 3
+
+ ; PAL_SLOTS2
+ RGB 31, 31, 31
+ RGB 31, 4, 19
+ RGB 31, 31, 0
+ RGB 3, 3, 3
+
+ ; PAL_SLOTS3
+ RGB 31, 31, 31
+ RGB 8, 31, 0
+ RGB 31, 31, 0
+ RGB 3, 3, 3
+
+ ; PAL_SLOTS4
+ RGB 31, 31, 31
+ RGB 0, 31, 31
+ RGB 31, 31, 0
+ RGB 3, 3, 3
+
+ ; PAL_BLACK
+ RGB 31, 31, 31
+ RGB 3, 3, 3
+ RGB 3, 3, 3
+ RGB 3, 3, 3
+
+ ; PAL_GREENBAR
+ RGB 31, 31, 31
+ RGB 31, 31, 0
+ RGB 0, 31, 0
+ RGB 3, 3, 3
+
+ ; PAL_YELLOWBAR
+ RGB 31, 31, 31
+ RGB 31, 31, 0
+ RGB 31, 18, 0
+ RGB 3, 3, 3
+
+ ; PAL_REDBAR
+ RGB 31, 31, 31
+ RGB 31, 31, 0
+ RGB 31, 0, 0
+ RGB 3, 3, 3
+
+ ; PAL_BADGE
+ RGB 31, 31, 31
+ RGB 23, 8, 0
+ RGB 17, 14, 11
+ RGB 3, 3, 3
+
+ ; PAL_CAVE
+ RGB 31, 31, 31
+ RGB 23, 8, 0
+ RGB 17, 14, 11
+ RGB 3, 3, 3
+
+ ; PAL_GAMEFREAK
+ RGB 31, 31, 31
+ RGB 31, 19, 0
+ RGB 19, 19, 0
+ RGB 3, 3, 3
+
+ ; PAL_25
+ RGB 31, 31, 31
+ RGB 31, 31, 0
+ RGB 11, 23, 31
+ RGB 3, 3, 3
+
+ ; PAL_26
+ RGB 31, 31, 31
+ RGB 31, 18, 0
+ RGB 19, 7, 1
+ RGB 3, 3, 3
+
+ ; PAL_27
+ RGB 31, 31, 31
+ RGB 9, 9, 9
+ RGB 31, 21, 0
+ RGB 3, 3, 3
diff --git a/data/super_rod.asm b/data/super_rod.asm
index d3d64632..01c6b588 100755
--- a/data/super_rod.asm
+++ b/data/super_rod.asm
@@ -1,100 +1,33 @@
-; super rod data
-; format: map, pointer to fishing group
-SuperRodData:
- dbw PALLET_TOWN, FishingGroup1
- dbw VIRIDIAN_CITY, FishingGroup1
- dbw CERULEAN_CITY, FishingGroup3
- dbw VERMILION_CITY, FishingGroup4
- dbw CELADON_CITY, FishingGroup5
- dbw FUCHSIA_CITY, FishingGroup10
- dbw CINNABAR_ISLAND, FishingGroup8
- dbw ROUTE_4, FishingGroup3
- dbw ROUTE_6, FishingGroup4
- dbw ROUTE_10, FishingGroup5
- dbw ROUTE_11, FishingGroup4
- dbw ROUTE_12, FishingGroup7
- dbw ROUTE_13, FishingGroup7
- dbw ROUTE_17, FishingGroup7
- dbw ROUTE_18, FishingGroup7
- dbw ROUTE_19, FishingGroup8
- dbw ROUTE_20, FishingGroup8
- dbw ROUTE_21, FishingGroup8
- dbw ROUTE_22, FishingGroup2
- dbw ROUTE_23, FishingGroup9
- dbw ROUTE_24, FishingGroup3
- dbw ROUTE_25, FishingGroup3
- dbw CERULEAN_GYM, FishingGroup3
- dbw VERMILION_DOCK, FishingGroup4
- dbw SEAFOAM_ISLANDS_B3F, FishingGroup8
- dbw SEAFOAM_ISLANDS_B4F, FishingGroup8
- dbw SAFARI_ZONE_EAST, FishingGroup6
- dbw SAFARI_ZONE_NORTH, FishingGroup6
- dbw SAFARI_ZONE_WEST, FishingGroup6
- dbw SAFARI_ZONE_CENTER, FishingGroup6
- dbw CERULEAN_CAVE_2F, FishingGroup9
- dbw CERULEAN_CAVE_B1F, FishingGroup9
- dbw CERULEAN_CAVE_1F, FishingGroup9
- db $FF
-
-; fishing groups
-; number of monsters, followed by level/monster pairs
-FishingGroup1:
- db 2
- db 15,TENTACOOL
- db 15,POLIWAG
-
-FishingGroup2:
- db 2
- db 15,GOLDEEN
- db 15,POLIWAG
-
-FishingGroup3:
- db 3
- db 15,PSYDUCK
- db 15,GOLDEEN
- db 15,KRABBY
-
-FishingGroup4:
- db 2
- db 15,KRABBY
- db 15,SHELLDER
-
-FishingGroup5:
- db 2
- db 23,POLIWHIRL
- db 15,SLOWPOKE
-
-FishingGroup6:
- db 4
- db 15,DRATINI
- db 15,KRABBY
- db 15,PSYDUCK
- db 15,SLOWPOKE
-
-FishingGroup7:
- db 4
- db 5,TENTACOOL
- db 15,KRABBY
- db 15,GOLDEEN
- db 15,MAGIKARP
-
-FishingGroup8:
- db 4
- db 15,STARYU
- db 15,HORSEA
- db 15,SHELLDER
- db 15,GOLDEEN
-
-FishingGroup9:
- db 4
- db 23,SLOWBRO
- db 23,SEAKING
- db 23,KINGLER
- db 23,SEADRA
-
-FishingGroup10:
- db 4
- db 23,SEAKING
- db 15,KRABBY
- db 15,GOLDEEN
- db 15,MAGIKARP
+FishingSlots::
+ 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 $ff
diff --git a/data/tileset_headers.asm b/data/tileset_headers.asm
index d8e0d9b4..c85a51e5 100755
--- a/data/tileset_headers.asm
+++ b/data/tileset_headers.asm
@@ -1,4 +1,5 @@
Tilesets:
+
tileset Overworld_Block, Overworld_GFX, Overworld_Coll, $FF,$FF,$FF, $52, OUTDOOR
tileset RedsHouse1_Block, RedsHouse1_GFX, RedsHouse1_Coll, $FF,$FF,$FF, $FF, INDOOR
tileset Mart_Block, Mart_GFX, Mart_Coll, $18,$19,$1E, $FF, INDOOR
@@ -23,3 +24,4 @@ Tilesets:
tileset Club_Block, Club_GFX, Club_Coll, $07,$17,$FF, $FF, INDOOR
tileset Facility_Block, Facility_GFX, Facility_Coll, $12,$FF,$FF, $FF, CAVE
tileset Plateau_Block, Plateau_GFX, Plateau_Coll, $FF,$FF,$FF, $45, CAVE
+ tileset BeachHouse_Block, BeachHouse_GFX, BeachHouse_Coll, $FF,$FF,$FF, $FF, INDOOR
diff --git a/data/title_mons.asm b/data/title_mons.asm
deleted file mode 100755
index c5d94301..00000000
--- a/data/title_mons.asm
+++ /dev/null
@@ -1,56 +0,0 @@
-TitleMons:
-; mons on the title screen are randomly chosen from here
-IF DEF(_RED)
- db CHARMANDER
- db SQUIRTLE
- db BULBASAUR
- 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(_GREEN)
- db BULBASAUR
- db CHARMANDER
- db SQUIRTLE
- db CATERPIE
- db NIDORAN_F
- db PINSIR
- 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 SQUIRTLE
- db CHARMANDER
- db BULBASAUR
- 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/tms.asm b/data/tms.asm
index 23c1685e..d61392c4 100755
--- a/data/tms.asm
+++ b/data/tms.asm
@@ -54,3 +54,4 @@ TechnicalMachines:
db SURF
db STRENGTH
db FLASH
+ db $ff ; terminator
diff --git a/data/town_map_entries.asm b/data/town_map_entries.asm
index 63ebd51b..eed56919 100755
--- a/data/town_map_entries.asm
+++ b/data/town_map_entries.asm
@@ -98,4 +98,5 @@ InternalMapEntries:
IMAP ROCK_TUNNEL_B1F, $E,$3,RockTunnelName
IMAP SILPH_CO_ELEVATOR, $A,$5,SilphCoName
IMAP AGATHAS_ROOM, $0,$2,PokemonLeagueName
+ IMAP BEACH_HOUSE, $6,$F,Route19Name
db $FF
diff --git a/data/trades.asm b/data/trades.asm
index cf0fcbfd..4fa52d30 100755
--- a/data/trades.asm
+++ b/data/trades.asm
@@ -1,12 +1,12 @@
TradeMons:
; givemonster, getmonster, textstring, nickname (11 bytes), 14 bytes total
- db NIDORINO, NIDORINA, 0,"TERRY@@@@@@"
- db ABRA, MR_MIME, 0,"MARCEL@@@@@"
- db BUTTERFREE,BEEDRILL, 2,"CHIKUCHIKU@"
- db PONYTA, SEEL, 0,"SAILOR@@@@@"
- db SPEAROW, FARFETCHD,2,"DUX@@@@@@@@"
- db SLOWBRO, LICKITUNG,0,"MARC@@@@@@@"
- db POLIWHIRL, JYNX, 1,"LOLA@@@@@@@"
- db RAICHU, ELECTRODE,1,"DORIS@@@@@@"
- db VENONAT, TANGELA, 2,"CRINKLES@@@"
- db NIDORAN_M, NIDORAN_F,2,"SPOT@@@@@@@"
+ db LICKITUNG, DUGTRIO, 0,"GURIO@@@@@@"
+ db CLEFAIRY, MR_MIME, 0,"MILES@@@@@@"
+ db BUTTERFREE,BEEDRILL,2,"STINGER@@@@"
+ db KANGASKHAN,MUK, 0,"STICKY@@@@@"
+ db MEW, MEW, 2,"BART@@@@@@@"
+ db TANGELA, PARASECT,0,"SPIKE@@@@@@"
+ db PIDGEOT, PIDGEOT, 1,"MARTY@@@@@@"
+ db GOLDUCK, RHYDON, 1,"BUFFY@@@@@@"
+ db GROWLITHE, DEWGONG, 2,"CEZANNE@@@@"
+ db CUBONE, MACHOKE, 2,"RICKY@@@@@@"
diff --git a/data/trainer_moves.asm b/data/trainer_moves.asm
index 2e7b52a5..696253e3 100755
--- a/data/trainer_moves.asm
+++ b/data/trainer_moves.asm
@@ -1,32 +1,160 @@
-LoneMoves:
-; these are used for gym leaders.
-; this is not automatic! you have to write the number you want to wLoneAttackNo
-; first. e.g., erika's script writes 4 to wLoneAttackNo to get mega drain,
-; the fourth entry in the list.
-
-; first byte: pokemon in the trainer's party that gets the move
-; second byte: move
-; unterminated
- 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
-
-TeamMoves:
-; these are used for elite four.
-; this is automatic, based on trainer class.
-; don't be confused by LoneMoves above, the two data structures are
- ; _completely_ unrelated.
-
-; first byte: trainer (all trainers in this class have this move)
-; second byte: move
-; ff-terminated
- db LORELEI,BLIZZARD
- db BRUNO,FISSURE
- db AGATHA,TOXIC
- db LANCE,BARRIER
- db $FF
+; yellow has its own format.
+
+; entry = trainerclass, trainerid, moveset+, 0
+; moveset = partymon location, partymon's move, moveid
+
+SpecialTrainerMoves:
+ db BUG_CATCHER,$f
+ db 2,2,TACKLE
+ db 2,3,STRING_SHOT
+ db 0
+
+ db YOUNGSTER,$e
+ 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 SONY3,$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 SONY3,$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 SONY3,$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 $ff
diff --git a/data/trainer_parties.asm b/data/trainer_parties.asm
index e448d431..0c3dcc8f 100755
--- a/data/trainer_parties.asm
+++ b/data/trainer_parties.asm
@@ -57,7 +57,6 @@ TrainerDataPointers:
; null-terminated
YoungsterData:
-; Route 3
db 11,RATTATA,EKANS,0
db 14,SPEAROW,0
; Mt. Moon 1F
@@ -77,12 +76,11 @@ 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
-; Route 3
+ db 7,CATERPIE,CATERPIE,0
+ db 6,METAPOD,CATERPIE,METAPOD,0
+ db 10,CATERPIE,0
db 10,CATERPIE,WEEDLE,CATERPIE,0
db 9,WEEDLE,KAKUNA,CATERPIE,METAPOD,0
db 11,CATERPIE,METAPOD,0
@@ -99,8 +97,8 @@ BugCatcherData:
; Route 9
db 19,BEEDRILL,BEEDRILL,0
db 20,CATERPIE,WEEDLE,VENONAT,0
+ db 8,CATERPIE,METAPOD,0
LassData:
-; Route 3
db 9,PIDGEY,PIDGEY,0
db 10,RATTATA,NIDORAN_M,0
db 14,JIGGLYPUFF,0
@@ -118,15 +116,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
db 18,MACHOP,SHELLDER,0
@@ -138,10 +137,10 @@ 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
@@ -156,11 +155,12 @@ 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
@@ -168,7 +168,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
@@ -176,7 +176,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
@@ -188,11 +188,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
db 30,RHYHORN,LICKITUNG,0
@@ -366,7 +367,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
@@ -391,7 +392,7 @@ PsychicData:
db 38,SLOWBRO,0
RockerData:
; Vermilion Gym
- db 20,VOLTORB,MAGNEMITE,VOLTORB,0
+ db 20,VOLTORB,VOLTORB,VOLTORB,0
; Route 12
db 29,VOLTORB,ELECTRODE,0
JugglerData:
@@ -459,17 +460,11 @@ BlackbeltData:
; Victory Road 2F
db 43,MACHOKE,MACHOP,MACHOKE,0
Green1Data:
- db 5,SQUIRTLE,0
- db 5,BULBASAUR,0
- db 5,CHARMANDER,0
+ 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
db $FF,66,TAUROS,67,EXEGGUTOR,68,ARCANINE,69,BLASTOISE,70,GYARADOS,0
@@ -505,11 +500,11 @@ ScientistData:
db 34,MAGNEMITE,ELECTRODE,0
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
db 13,RATTATA,ZUBAT,0
@@ -572,6 +567,16 @@ RocketData:
; Silph Co. 11F
db 25,RATTATA,RATTATA,ZUBAT,RATTATA,EKANS,0
db 32,CUBONE,DROWZEE,MAROWAK,0
+;JessieJamesData:
+ 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 JessieJames trainers
+ db 16,KOFFING,0
+ db 27,KOFFING,0
+ db 29,WEEZING,0
+ db 33,WEEZING,0
CooltrainerMData:
; Viridian Gym
db 39,NIDORINO,NIDOKING,0
@@ -606,50 +611,48 @@ CooltrainerFData:
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:
; 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
+ 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
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,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
ChannelerData:
diff --git a/data/warp_tile_ids.asm b/data/warp_tile_ids.asm
index 6fd326cc..4edc48a5 100755
--- a/data/warp_tile_ids.asm
+++ b/data/warp_tile_ids.asm
@@ -23,6 +23,7 @@ WarpTileIDPointers:
dw ClubWarpTileIDs
dw FacilityWarpTileIDs
dw PlateauWarpTileIDs
+ dw BeachHouseWarpTileIDs
OverworldWarpTileIDs:
db $1B,$58,$FF
@@ -83,3 +84,6 @@ PlateauWarpTileIDs:
ShipPortWarpTileIDs:
ClubWarpTileIDs:
db $FF
+
+BeachHouseWarpTileIDs:
+ db $FF
diff --git a/data/wildPokemon/ceruleancave1.asm b/data/wildPokemon/ceruleancave1.asm
index 20e8643a..ff7be04e 100644
--- a/data/wildPokemon/ceruleancave1.asm
+++ b/data/wildPokemon/ceruleancave1.asm
@@ -1,18 +1,14 @@
DungeonMons1:
db $0A
- 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 52,SANDSLASH
- ENDC
- db 49,KADABRA
- db 52,PARASECT
- db 53,RAICHU
- db 53,DITTO
+ db 50,GOLBAT
+ db 55,GOLBAT
+ db 45,GRAVELER
+ db 55,GLOOM
+ db 55,WEEPINBELL
+ db 52,SANDSLASH
+ db 54,VENOMOTH
+ db 54,PARASECT
+ db 55,DITTO
+ db 60,DITTO
db $00
+
diff --git a/data/wildPokemon/ceruleancave2.asm b/data/wildPokemon/ceruleancave2.asm
index 5afe55ac..1fd20019 100644
--- a/data/wildPokemon/ceruleancave2.asm
+++ b/data/wildPokemon/ceruleancave2.asm
@@ -1,13 +1,14 @@
DungeonMons2:
db $0F
- 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
db $00
+
diff --git a/data/wildPokemon/ceruleancaveb1.asm b/data/wildPokemon/ceruleancaveb1.asm
index 245d5912..5848678f 100644
--- a/data/wildPokemon/ceruleancaveb1.asm
+++ b/data/wildPokemon/ceruleancaveb1.asm
@@ -1,18 +1,14 @@
DungeonMonsB1:
db $19
- 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
db $00
+
diff --git a/data/wildPokemon/diglettscave.asm b/data/wildPokemon/diglettscave.asm
index 37512687..0b8ec1c7 100755
--- a/data/wildPokemon/diglettscave.asm
+++ b/data/wildPokemon/diglettscave.asm
@@ -11,3 +11,4 @@ CaveMons:
db 29,DUGTRIO
db 31,DUGTRIO
db $00
+
diff --git a/data/wildPokemon/mansion1.asm b/data/wildPokemon/mansion1.asm
index 22ad032b..2e5a8f51 100755
--- a/data/wildPokemon/mansion1.asm
+++ b/data/wildPokemon/mansion1.asm
@@ -1,27 +1,14 @@
MansionMons1:
db $0A
- IF DEF(_RED)
- db 32,KOFFING
- db 30,KOFFING
- db 34,PONYTA
- db 30,PONYTA
- 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 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 38,GROWLITHE
db $00
+
diff --git a/data/wildPokemon/mansion2.asm b/data/wildPokemon/mansion2.asm
index 985474fc..e830560a 100755
--- a/data/wildPokemon/mansion2.asm
+++ b/data/wildPokemon/mansion2.asm
@@ -1,27 +1,14 @@
MansionMons2:
db $0A
- 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
db $00
+
diff --git a/data/wildPokemon/mansion3.asm b/data/wildPokemon/mansion3.asm
index 9c5521ae..cc180e3b 100755
--- a/data/wildPokemon/mansion3.asm
+++ b/data/wildPokemon/mansion3.asm
@@ -1,27 +1,14 @@
MansionMons3:
db $0A
- 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 35,GRIMER
- db 32,PONYTA
- db 34,MAGMAR
- db 40,MUK
- db 34,KOFFING
- db 38,MUK
- db 36,PONYTA
- db 42,WEEZING
- ENDC
+ db 40,RATTATA
+ db 40,RATICATE
+ db 32,GRIMER
+ db 35,GRIMER
+ db 43,RATTATA
+ db 43,RATICATE
+ db 38,GRIMER
+ db 38,GRIMER
+ db 38,MUK
+ db 41,MUK
db $00
+
diff --git a/data/wildPokemon/mansionb1.asm b/data/wildPokemon/mansionb1.asm
index 83266ddd..dcace0d8 100755
--- a/data/wildPokemon/mansionb1.asm
+++ b/data/wildPokemon/mansionb1.asm
@@ -1,27 +1,13 @@
MansionMonsB1:
db $0A
- 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 35,GRIMER
+ 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
db $00
diff --git a/data/wildPokemon/mtmoon1.asm b/data/wildPokemon/mtmoon1.asm
index 44b34c45..75f19efd 100755
--- a/data/wildPokemon/mtmoon1.asm
+++ b/data/wildPokemon/mtmoon1.asm
@@ -1,13 +1,14 @@
MoonMons1:
db $0A
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
db $00
+
diff --git a/data/wildPokemon/mtmoonb1.asm b/data/wildPokemon/mtmoonb1.asm
index 5c0d8a53..61c0b05c 100755
--- a/data/wildPokemon/mtmoonb1.asm
+++ b/data/wildPokemon/mtmoonb1.asm
@@ -1,13 +1,14 @@
MoonMonsB1:
db $0A
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
db $00
+
diff --git a/data/wildPokemon/mtmoonb2.asm b/data/wildPokemon/mtmoonb2.asm
index cbf97e7e..27c76500 100755
--- a/data/wildPokemon/mtmoonb2.asm
+++ b/data/wildPokemon/mtmoonb2.asm
@@ -1,13 +1,14 @@
MoonMonsB2:
db $0A
- 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
db $00
+
diff --git a/data/wildPokemon/nomons.asm b/data/wildPokemon/nomons.asm
index ce7f7ede..895cf2e0 100755
--- a/data/wildPokemon/nomons.asm
+++ b/data/wildPokemon/nomons.asm
@@ -1,3 +1,4 @@
NoMons:
db $00
db $00
+
diff --git a/data/wildPokemon/pokemontower1.asm b/data/wildPokemon/pokemontower1.asm
index df951e70..4911c790 100755
--- a/data/wildPokemon/pokemontower1.asm
+++ b/data/wildPokemon/pokemontower1.asm
@@ -1,3 +1,4 @@
TowerMons1:
db $00
db $00
+
diff --git a/data/wildPokemon/pokemontower2.asm b/data/wildPokemon/pokemontower2.asm
index dcbe0da0..a849668d 100755
--- a/data/wildPokemon/pokemontower2.asm
+++ b/data/wildPokemon/pokemontower2.asm
@@ -1,3 +1,4 @@
TowerMons2:
db $00
db $00
+
diff --git a/data/wildPokemon/pokemontower3.asm b/data/wildPokemon/pokemontower3.asm
index 135ed84f..c071c972 100755
--- a/data/wildPokemon/pokemontower3.asm
+++ b/data/wildPokemon/pokemontower3.asm
@@ -4,10 +4,11 @@ TowerMons3:
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
db $00
+
diff --git a/data/wildPokemon/pokemontower4.asm b/data/wildPokemon/pokemontower4.asm
index 0c84b0cf..35be620e 100755
--- a/data/wildPokemon/pokemontower4.asm
+++ b/data/wildPokemon/pokemontower4.asm
@@ -4,10 +4,11 @@ TowerMons4:
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
db $00
+
diff --git a/data/wildPokemon/pokemontower5.asm b/data/wildPokemon/pokemontower5.asm
index 440dbf8d..55fe2e27 100755
--- a/data/wildPokemon/pokemontower5.asm
+++ b/data/wildPokemon/pokemontower5.asm
@@ -1,13 +1,14 @@
TowerMons5:
- db $0A
- db 20,GASTLY
- db 21,GASTLY
+ db $0F
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
db $00
+
diff --git a/data/wildPokemon/pokemontower6.asm b/data/wildPokemon/pokemontower6.asm
index 553fdb5d..6e914c5c 100755
--- a/data/wildPokemon/pokemontower6.asm
+++ b/data/wildPokemon/pokemontower6.asm
@@ -1,13 +1,14 @@
TowerMons6:
db $0F
- 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
db $00
+
diff --git a/data/wildPokemon/pokemontower7.asm b/data/wildPokemon/pokemontower7.asm
index 0f7e66e9..34ca6225 100755
--- a/data/wildPokemon/pokemontower7.asm
+++ b/data/wildPokemon/pokemontower7.asm
@@ -1,13 +1,14 @@
TowerMons7:
- db $0F
- db 21,GASTLY
- db 22,GASTLY
- db 23,GASTLY
+ db $14
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
db $00
+
diff --git a/data/wildPokemon/powerplant.asm b/data/wildPokemon/powerplant.asm
index 35eece95..8a1667a5 100755
--- a/data/wildPokemon/powerplant.asm
+++ b/data/wildPokemon/powerplant.asm
@@ -1,19 +1,13 @@
PowerPlantMons:
db $0A
- 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
db $00
diff --git a/data/wildPokemon/rocktunnel1.asm b/data/wildPokemon/rocktunnel1.asm
index a36f2092..9999490e 100755
--- a/data/wildPokemon/rocktunnel1.asm
+++ b/data/wildPokemon/rocktunnel1.asm
@@ -1,13 +1,14 @@
TunnelMonsB1:
db $0F
- 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
db $00
+
diff --git a/data/wildPokemon/rocktunnel2.asm b/data/wildPokemon/rocktunnel2.asm
index 2fc7ef94..41111909 100755
--- a/data/wildPokemon/rocktunnel2.asm
+++ b/data/wildPokemon/rocktunnel2.asm
@@ -1,13 +1,14 @@
TunnelMonsB2:
db $0F
- 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
db $00
+
diff --git a/data/wildPokemon/route1.asm b/data/wildPokemon/route1.asm
index f618c34f..4b85ba40 100755
--- a/data/wildPokemon/route1.asm
+++ b/data/wildPokemon/route1.asm
@@ -1,13 +1,14 @@
Route1Mons:
db $19
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
db $00
+
diff --git a/data/wildPokemon/route10.asm b/data/wildPokemon/route10.asm
index 34e0b5ee..af835c99 100755
--- a/data/wildPokemon/route10.asm
+++ b/data/wildPokemon/route10.asm
@@ -1,27 +1,14 @@
Route10Mons:
db $0F
- IF DEF(_RED)
- db 16,VOLTORB
- db 16,SPEAROW
- db 14,VOLTORB
- 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 16,VOLTORB
- db 16,SPEAROW
- db 14,VOLTORB
- 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
db $00
+
diff --git a/data/wildPokemon/route11.asm b/data/wildPokemon/route11.asm
index 9e4e3644..0b1425c0 100755
--- a/data/wildPokemon/route11.asm
+++ b/data/wildPokemon/route11.asm
@@ -1,27 +1,14 @@
Route11Mons:
db $0F
- IF DEF(_RED)
- db 14,EKANS
- db 15,SPEAROW
- db 12,EKANS
- db 9,DROWZEE
- db 13,SPEAROW
- db 13,DROWZEE
- db 15,EKANS
- db 17,SPEAROW
- db 11,DROWZEE
- db 15,DROWZEE
- 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
- db 17,SPEAROW
- db 11,DROWZEE
- db 15,DROWZEE
- ENDC
+ 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
db $00
+
diff --git a/data/wildPokemon/route12.asm b/data/wildPokemon/route12.asm
index 45dfbc9d..6dc3d739 100755
--- a/data/wildPokemon/route12.asm
+++ b/data/wildPokemon/route12.asm
@@ -1,27 +1,25 @@
Route12Mons:
db $0F
- 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 $00
+ 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
+
+ db $03
+ 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
+
diff --git a/data/wildPokemon/route13.asm b/data/wildPokemon/route13.asm
index 2a1a6cb5..3b6ca152 100755
--- a/data/wildPokemon/route13.asm
+++ b/data/wildPokemon/route13.asm
@@ -1,28 +1,25 @@
Route13Mons:
- IF DEF(_RED)
- db $14
- 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 $14
- 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
- db $00
+ db $0F
+ 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
+
+ db $03
+ 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
+
diff --git a/data/wildPokemon/route14.asm b/data/wildPokemon/route14.asm
index aad5aa48..9eb0e4c5 100755
--- a/data/wildPokemon/route14.asm
+++ b/data/wildPokemon/route14.asm
@@ -1,27 +1,14 @@
Route14Mons:
db $0F
- 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
- db 28,PIDGEOTTO
- db 30,PIDGEOTTO
- 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
- db 28,PIDGEOTTO
- db 30,PIDGEOTTO
- ENDC
+ db 26,ODDISH
+ db 26,BELLSPROUT
+ db 24,VENONAT
+ db 30,PIDGEOTTO
+ db 28,ODDISH
+ db 28,BELLSPROUT
+ db 30,GLOOM
+ db 30,WEEPINBELL
+ db 27,VENONAT
+ db 30,VENOMOTH
db $00
+
diff --git a/data/wildPokemon/route15.asm b/data/wildPokemon/route15.asm
index b4762230..30d96ed2 100755
--- a/data/wildPokemon/route15.asm
+++ b/data/wildPokemon/route15.asm
@@ -1,27 +1,14 @@
Route15Mons:
db $0F
- 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
- db 28,PIDGEOTTO
- db 30,PIDGEOTTO
- 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 30,WEEPINBELL
- db 28,PIDGEOTTO
- db 30,PIDGEOTTO
- ENDC
+ db 26,ODDISH
+ db 26,BELLSPROUT
+ db 24,VENONAT
+ db 32,PIDGEOTTO
+ db 28,ODDISH
+ db 28,BELLSPROUT
+ db 30,GLOOM
+ db 30,WEEPINBELL
+ db 27,VENONAT
+ db 30,VENOMOTH
db $00
+
diff --git a/data/wildPokemon/route16.asm b/data/wildPokemon/route16.asm
index c2421c50..eeefa9ba 100755
--- a/data/wildPokemon/route16.asm
+++ b/data/wildPokemon/route16.asm
@@ -1,13 +1,14 @@
Route16Mons:
db $19
- 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
db $00
+
diff --git a/data/wildPokemon/route17.asm b/data/wildPokemon/route17.asm
index 8dffd9a3..ce72f376 100755
--- a/data/wildPokemon/route17.asm
+++ b/data/wildPokemon/route17.asm
@@ -1,13 +1,14 @@
Route17Mons:
db $19
- 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
db $00
+
diff --git a/data/wildPokemon/route18.asm b/data/wildPokemon/route18.asm
index 47bd247d..62ce6c3e 100755
--- a/data/wildPokemon/route18.asm
+++ b/data/wildPokemon/route18.asm
@@ -1,13 +1,14 @@
Route18Mons:
db $19
- 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
db $00
+
diff --git a/data/wildPokemon/waterpokemon.asm b/data/wildPokemon/route19.asm
index 07c6a187..77e1e3ef 100755..100644
--- a/data/wildPokemon/waterpokemon.asm
+++ b/data/wildPokemon/route19.asm
@@ -1,5 +1,6 @@
-WaterMons:
+Route19Mons:
db $00
+
db $05
db 5,TENTACOOL
db 10,TENTACOOL
@@ -11,3 +12,4 @@ WaterMons:
db 30,TENTACOOL
db 35,TENTACOOL
db 40,TENTACOOL
+
diff --git a/data/wildPokemon/route2.asm b/data/wildPokemon/route2.asm
index ad958ea5..93f3726f 100755
--- a/data/wildPokemon/route2.asm
+++ b/data/wildPokemon/route2.asm
@@ -2,23 +2,13 @@ Route2Mons:
db $19
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
- ENDC
- IF DEF(_BLUE)
- db 3,CATERPIE
- ENDC
- db 2,RATTATA
- db 5,RATTATA
- IF DEF(_RED)
- db 4,WEEDLE
- db 5,WEEDLE
- ENDC
- IF DEF(_BLUE)
- db 4,CATERPIE
- db 5,CATERPIE
- ENDC
+ db 6,NIDORAN_M
+ db 6,NIDORAN_F
+ db 7,PIDGEY
+ db 7,PIDGEY
db $00
+
diff --git a/data/wildPokemon/route20.asm b/data/wildPokemon/route20.asm
new file mode 100644
index 00000000..b955c330
--- /dev/null
+++ b/data/wildPokemon/route20.asm
@@ -0,0 +1,15 @@
+Route20Mons:
+ db $00
+
+ db $05
+ 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
+
diff --git a/data/wildPokemon/route21.asm b/data/wildPokemon/route21.asm
index 3cc73ba0..11ac7e6b 100755
--- a/data/wildPokemon/route21.asm
+++ b/data/wildPokemon/route21.asm
@@ -1,15 +1,16 @@
Route21Mons:
db $19
- 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
+
db $05
db 5,TENTACOOL
db 10,TENTACOOL
@@ -21,3 +22,4 @@ Route21Mons:
db 30,TENTACOOL
db 35,TENTACOOL
db 40,TENTACOOL
+
diff --git a/data/wildPokemon/route22.asm b/data/wildPokemon/route22.asm
index 750a2f4e..39f1f29c 100755
--- a/data/wildPokemon/route22.asm
+++ b/data/wildPokemon/route22.asm
@@ -1,27 +1,14 @@
Route22Mons:
db $19
- IF DEF(_RED)
- db 3,RATTATA
- 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,RATTATA
- 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 4,NIDORAN_M
- ENDC
+ db 2,NIDORAN_M
+ db 2,NIDORAN_F
+ db 3,MANKEY
+ db 3,RATTATA
+ db 4,NIDORAN_M
+ db 4,NIDORAN_F
+ db 5,MANKEY
+ db 2,SPEAROW
+ db 4,SPEAROW
+ db 6,SPEAROW
db $00
+
diff --git a/data/wildPokemon/route23.asm b/data/wildPokemon/route23.asm
index a057d24d..43de8c2b 100755
--- a/data/wildPokemon/route23.asm
+++ b/data/wildPokemon/route23.asm
@@ -1,23 +1,14 @@
Route23Mons:
db $0A
- 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
db $00
+
diff --git a/data/wildPokemon/route24.asm b/data/wildPokemon/route24.asm
index 3a745f36..df4a3bce 100755
--- a/data/wildPokemon/route24.asm
+++ b/data/wildPokemon/route24.asm
@@ -1,27 +1,14 @@
Route24Mons:
db $19
- IF DEF(_RED)
- db 7,WEEDLE
- db 8,KAKUNA
- db 12,PIDGEY
- db 12,ODDISH
- db 13,ODDISH
- db 10,ABRA
- db 14,ODDISH
- db 13,PIDGEY
- db 8,ABRA
- db 12,ABRA
- 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
- db 13,PIDGEY
- db 8,ABRA
- db 12,ABRA
- ENDC
+ db 12,ODDISH
+ db 12,BELLSPROUT
+ db 13,PIDGEY
+ db 14,ODDISH
+ db 14,BELLSPROUT
+ db 15,PIDGEY
+ db 13,VENONAT
+ db 16,VENONAT
+ db 17,PIDGEY
+ db 17,PIDGEOTTO
db $00
+
diff --git a/data/wildPokemon/route25.asm b/data/wildPokemon/route25.asm
index 4884fa64..1546dd74 100755
--- a/data/wildPokemon/route25.asm
+++ b/data/wildPokemon/route25.asm
@@ -1,27 +1,14 @@
Route25Mons:
db $0F
- 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 14,BELLSPROUT
- db 10,ABRA
- db 7,KAKUNA
- db 8,WEEDLE
- ENDC
+ db 12,ODDISH
+ db 12,BELLSPROUT
+ db 13,PIDGEY
+ db 14,ODDISH
+ db 14,BELLSPROUT
+ db 15,PIDGEY
+ db 13,VENONAT
+ db 16,VENONAT
+ db 17,PIDGEY
+ db 17,PIDGEOTTO
db $00
+
diff --git a/data/wildPokemon/route3.asm b/data/wildPokemon/route3.asm
index dea820a4..f867fbbf 100755
--- a/data/wildPokemon/route3.asm
+++ b/data/wildPokemon/route3.asm
@@ -1,13 +1,14 @@
Route3Mons:
db $14
- 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
db $00
+
diff --git a/data/wildPokemon/route4.asm b/data/wildPokemon/route4.asm
index 624d58de..b62126d8 100755
--- a/data/wildPokemon/route4.asm
+++ b/data/wildPokemon/route4.asm
@@ -1,27 +1,14 @@
Route4Mons:
db $14
- IF DEF(_RED)
- db 10,RATTATA
- db 10,SPEAROW
- db 8,RATTATA
- 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 10,RATTATA
- db 10,SPEAROW
- db 8,RATTATA
- db 6,SANDSHREW
- db 8,SPEAROW
- db 10,SANDSHREW
- db 12,RATTATA
- db 12,SPEAROW
- db 8,SANDSHREW
- db 12,SANDSHREW
- ENDC
+ 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 $00
+
diff --git a/data/wildPokemon/route5.asm b/data/wildPokemon/route5.asm
index cb8c583b..1e9703a7 100755
--- a/data/wildPokemon/route5.asm
+++ b/data/wildPokemon/route5.asm
@@ -1,27 +1,14 @@
Route5Mons:
db $0F
- 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 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 15,PIDGEY
+ db 14,RATTATA
+ db 7,ABRA
+ db 16,PIDGEY
+ db 16,RATTATA
+ db 17,PIDGEY
+ db 17,PIDGEOTTO
+ db 3,JIGGLYPUFF
+ db 5,JIGGLYPUFF
+ db 7,JIGGLYPUFF
db $00
+
diff --git a/data/wildPokemon/route6.asm b/data/wildPokemon/route6.asm
index 92512ffb..b84e5029 100755
--- a/data/wildPokemon/route6.asm
+++ b/data/wildPokemon/route6.asm
@@ -1,27 +1,25 @@
Route6Mons:
db $0F
- 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 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 $00
+ db 15,PIDGEY
+ db 14,RATTATA
+ db 7,ABRA
+ db 16,PIDGEY
+ db 16,RATTATA
+ db 17,PIDGEY
+ db 17,PIDGEOTTO
+ db 3,JIGGLYPUFF
+ db 5,JIGGLYPUFF
+ db 7,JIGGLYPUFF
+
+ db $03
+ 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
+
diff --git a/data/wildPokemon/route7.asm b/data/wildPokemon/route7.asm
index 559c98ee..dad77e69 100755
--- a/data/wildPokemon/route7.asm
+++ b/data/wildPokemon/route7.asm
@@ -1,27 +1,14 @@
Route7Mons:
db $0F
- IF DEF(_RED)
- db 19,PIDGEY
- db 19,ODDISH
- db 17,MANKEY
- db 22,ODDISH
- db 22,PIDGEY
- db 18,MANKEY
- db 18,GROWLITHE
- db 20,GROWLITHE
- db 19,MANKEY
- db 20,MANKEY
- ENDC
- IF DEF(_BLUE)
- db 19,PIDGEY
- 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,PIDGEY
+ db 22,PIDGEY
+ db 20,RATTATA
+ db 15,ABRA
+ db 19,ABRA
+ db 24,PIDGEOTTO
+ db 26,ABRA
+ db 19,JIGGLYPUFF
+ db 24,JIGGLYPUFF
+ db 24,JIGGLYPUFF
db $00
+
diff --git a/data/wildPokemon/route8.asm b/data/wildPokemon/route8.asm
index 8a0bfa31..8b47b163 100755
--- a/data/wildPokemon/route8.asm
+++ b/data/wildPokemon/route8.asm
@@ -1,27 +1,14 @@
Route8Mons:
db $0F
- IF DEF(_RED)
- db 18,PIDGEY
- 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,PIDGEY
- 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 20,PIDGEY
+ 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
db $00
+
diff --git a/data/wildPokemon/route9.asm b/data/wildPokemon/route9.asm
index 716589b0..95f5b451 100755
--- a/data/wildPokemon/route9.asm
+++ b/data/wildPokemon/route9.asm
@@ -1,27 +1,14 @@
Route9Mons:
db $0F
- IF DEF(_RED)
- db 16,RATTATA
- db 16,SPEAROW
- db 14,RATTATA
- db 11,EKANS
- db 13,SPEAROW
- db 15,EKANS
- db 17,RATTATA
- db 17,SPEAROW
- db 13,EKANS
- db 17,EKANS
- ENDC
- IF DEF(_BLUE)
- db 16,RATTATA
- db 16,SPEAROW
- db 14,RATTATA
- db 11,SANDSHREW
- db 13,SPEAROW
- db 15,SANDSHREW
- db 17,RATTATA
- db 17,SPEAROW
- db 13,SANDSHREW
- db 17,SANDSHREW
- ENDC
+ db 16,NIDORAN_M
+ db 16,NIDORAN_F
+ db 18,RATTATA
+ db 18,NIDORAN_M
+ db 18,NIDORAN_F
+ db 17,SPEAROW
+ db 18,NIDORINO
+ db 18,NIDORINA
+ db 20,RATICATE
+ db 19,FEAROW
db $00
+
diff --git a/data/wildPokemon/safarizone1.asm b/data/wildPokemon/safarizone1.asm
index 3d77b6fe..c8632351 100755
--- a/data/wildPokemon/safarizone1.asm
+++ b/data/wildPokemon/safarizone1.asm
@@ -1,27 +1,14 @@
ZoneMons1:
db $1E
- 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
db $00
+
diff --git a/data/wildPokemon/safarizone2.asm b/data/wildPokemon/safarizone2.asm
index c1b6a547..1e4a6744 100755
--- a/data/wildPokemon/safarizone2.asm
+++ b/data/wildPokemon/safarizone2.asm
@@ -1,28 +1,14 @@
ZoneMons2:
db $1E
- IF DEF(_RED)
- db 22,NIDORAN_M
- ENDC
- IF DEF(_BLUE)
- db 22,NIDORAN_F
- ENDC
- db 26,RHYHORN
- db 23,PARAS
- db 25,EXEGGCUTE
- IF DEF(_RED)
- db 30,NIDORINO
- ENDC
- IF DEF(_BLUE)
- db 30,NIDORINA
- ENDC
- db 27,EXEGGCUTE
- IF DEF(_RED)
- db 30,NIDORINA
- ENDC
- IF DEF(_BLUE)
- 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
db $00
+
diff --git a/data/wildPokemon/safarizone3.asm b/data/wildPokemon/safarizone3.asm
index 47b6a102..3424f1d7 100755
--- a/data/wildPokemon/safarizone3.asm
+++ b/data/wildPokemon/safarizone3.asm
@@ -1,27 +1,14 @@
ZoneMons3:
db $1E
- IF DEF(_RED)
- db 25,NIDORAN_M
- db 26,DODUO
- db 23,VENONAT
- db 24,EXEGGCUTE
- db 33,NIDORINO
- db 26,EXEGGCUTE
- db 25,NIDORAN_F
- db 31,VENOMOTH
- db 26,TAUROS
- db 28,KANGASKHAN
- 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
- db 31,VENOMOTH
- db 26,TAUROS
- db 28,KANGASKHAN
- ENDC
+ db 29,NIDORAN_M
+ db 21,NIDORAN_F
+ db 22,EXEGGCUTE
+ db 21,TAUROS
+ db 32,NIDORINO
+ db 19,CUBONE
+ db 26,EXEGGCUTE
+ db 24,MAROWAK
+ db 25,PINSIR
+ db 27,TANGELA
db $00
+
diff --git a/data/wildPokemon/safarizonecenter.asm b/data/wildPokemon/safarizonecenter.asm
index 0cd5323a..e563fff2 100755
--- a/data/wildPokemon/safarizonecenter.asm
+++ b/data/wildPokemon/safarizonecenter.asm
@@ -1,27 +1,14 @@
ZoneMonsCenter:
db $1E
- IF DEF(_RED)
- db 22,NIDORAN_M
- db 25,RHYHORN
- db 22,VENONAT
- db 24,EXEGGCUTE
- db 31,NIDORINO
- db 25,EXEGGCUTE
- db 31,NIDORINA
- db 30,PARASECT
- db 23,SCYTHER
- db 23,CHANSEY
- 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
- db 23,CHANSEY
- ENDC
+ db 14,NIDORAN_M
+ db 36,NIDORAN_F
+ db 24,EXEGGCUTE
+ db 20,RHYHORN
+ db 23,NIDORINO
+ db 27,PARASECT
+ db 27,PARAS
+ db 32,PARASECT
+ db 22,TANGELA
+ db 7,CHANSEY
db $00
+
diff --git a/data/wildPokemon/seafoamisland1.asm b/data/wildPokemon/seafoamisland1.asm
index 3c431f9a..f4799c12 100755
--- a/data/wildPokemon/seafoamisland1.asm
+++ b/data/wildPokemon/seafoamisland1.asm
@@ -1,27 +1,14 @@
IslandMons1:
db $0F
- IF DEF(_RED)
- db 30,SEEL
- 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,SEEL
- db 30,PSYDUCK
- db 30,STARYU
- db 30,KRABBY
- db 28,KRABBY
- db 21,ZUBAT
- db 29,GOLBAT
- db 28,SLOWPOKE
- db 28,STARYU
- db 38,SLOWBRO
- ENDC
+ db 18,ZUBAT
+ db 25,KRABBY
+ db 27,KRABBY
+ db 27,ZUBAT
+ db 36,ZUBAT
+ db 28,SLOWPOKE
+ db 30,SLOWPOKE
+ db 9,ZUBAT
+ db 27,GOLBAT
+ db 36,GOLBAT
db $00
+
diff --git a/data/wildPokemon/seafoamislandb1.asm b/data/wildPokemon/seafoamislandb1.asm
index 6f96f240..2f0f255e 100755
--- a/data/wildPokemon/seafoamislandb1.asm
+++ b/data/wildPokemon/seafoamislandb1.asm
@@ -1,27 +1,14 @@
IslandMonsB1:
db $0A
- 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
db $00
+
diff --git a/data/wildPokemon/seafoamislandb2.asm b/data/wildPokemon/seafoamislandb2.asm
index 7191fea9..f3a23b07 100755
--- a/data/wildPokemon/seafoamislandb2.asm
+++ b/data/wildPokemon/seafoamislandb2.asm
@@ -1,27 +1,14 @@
IslandMonsB2:
db $0A
- IF DEF(_RED)
- db 30,SEEL
- 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,SEEL
- 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
db $00
+
diff --git a/data/wildPokemon/seafoamislandb3.asm b/data/wildPokemon/seafoamislandb3.asm
index 9778c0e9..ddf6acd3 100755
--- a/data/wildPokemon/seafoamislandb3.asm
+++ b/data/wildPokemon/seafoamislandb3.asm
@@ -1,27 +1,25 @@
IslandMonsB3:
db $0A
- 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
- db 37,DEWGONG
- ENDC
- IF DEF(_BLUE)
- db 31,PSYDUCK
- db 31,SEEL
- db 33,PSYDUCK
- db 33,SEEL
- db 29,KRABBY
- db 31,STARYU
- db 31,KRABBY
- db 29,STARYU
- db 39,KINGLER
- db 37,DEWGONG
- ENDC
- db $00
+ db 27,GOLBAT
+ db 36,ZUBAT
+ db 29,KRABBY
+ db 27,ZUBAT
+ db 30,KINGLER
+ db 26,SEEL
+ db 31,KRABBY
+ db 30,SEEL
+ db 28,DEWGONG
+ db 32,DEWGONG
+
+ db $05
+ 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
+
diff --git a/data/wildPokemon/seafoamislandb4.asm b/data/wildPokemon/seafoamislandb4.asm
index 3948470b..dd842dda 100755
--- a/data/wildPokemon/seafoamislandb4.asm
+++ b/data/wildPokemon/seafoamislandb4.asm
@@ -1,27 +1,25 @@
IslandMonsB4:
db $0A
- 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
- db 32,GOLBAT
- 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
- db 32,GOLBAT
- ENDC
- db $00
+ 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
+
+ db $05
+ 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
+
diff --git a/data/wildPokemon/victoryroad1.asm b/data/wildPokemon/victoryroad1.asm
index 60aae31a..f3e029fa 100755
--- a/data/wildPokemon/victoryroad1.asm
+++ b/data/wildPokemon/victoryroad1.asm
@@ -1,13 +1,14 @@
PlateauMons1:
db $0F
- 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
db $00
+
diff --git a/data/wildPokemon/victoryroad2.asm b/data/wildPokemon/victoryroad2.asm
index 580d644d..fcd910d2 100755
--- a/data/wildPokemon/victoryroad2.asm
+++ b/data/wildPokemon/victoryroad2.asm
@@ -1,13 +1,14 @@
PlateauMons2:
db $0A
- 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
db $00
+
diff --git a/data/wildPokemon/victoryroad3.asm b/data/wildPokemon/victoryroad3.asm
index 80d7ef3e..ed4d773b 100755
--- a/data/wildPokemon/victoryroad3.asm
+++ b/data/wildPokemon/victoryroad3.asm
@@ -1,13 +1,14 @@
PlateauMons3:
db $0F
- 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
db $00
+
diff --git a/data/wildPokemon/viridianforest.asm b/data/wildPokemon/viridianforest.asm
index ae9a5a70..eb4889a7 100755
--- a/data/wildPokemon/viridianforest.asm
+++ b/data/wildPokemon/viridianforest.asm
@@ -1,25 +1,14 @@
ForestMons:
- db $08
- IF DEF(_RED)
- db 4,WEEDLE
- db 5,KAKUNA
- db 3,WEEDLE
- db 5,WEEDLE
- db 4,KAKUNA
- db 6,KAKUNA
- db 4,METAPOD
- db 3,CATERPIE
- ENDC
- IF DEF(_BLUE)
- db 4,CATERPIE
- db 5,METAPOD
- db 3,CATERPIE
- db 5,CATERPIE
- db 4,METAPOD
- db 6,METAPOD
- db 4,KAKUNA
- db 3,WEEDLE
- ENDC
- db 3,PIKACHU
- db 5,PIKACHU
+ db $19
+ db 3,CATERPIE
+ db 4,METAPOD
+ db 4,CATERPIE
+ db 5,CATERPIE
+ db 4,PIDGEY
+ db 6,PIDGEY
+ db 6,CATERPIE
+ db 6,METAPOD
+ db 8,PIDGEY
+ db 9,PIDGEOTTO
db $00
+
diff --git a/data/wild_mons.asm b/data/wild_mons.asm
index e089a582..ac4a8897 100755
--- a/data/wild_mons.asm
+++ b/data/wild_mons.asm
@@ -29,8 +29,8 @@ WildDataPointers:
dw Route16Mons ; ROUTE_16
dw Route17Mons ; ROUTE_17
dw Route18Mons ; ROUTE_18
- dw WaterMons ; ROUTE_19
- dw WaterMons ; ROUTE_20
+ dw Route19Mons ; ROUTE_19
+ dw Route20Mons ; ROUTE_20
dw Route21Mons ; ROUTE_21
dw Route22Mons ; ROUTE_22
dw Route23Mons ; ROUTE_23
@@ -247,6 +247,7 @@ WildDataPointers:
dw NoMons
dw NoMons
dw NoMons
+ dw NoMons
dw $FFFF
; wild pokemon data is divided into two parts.
@@ -299,7 +300,8 @@ INCLUDE "data/wildPokemon/safarizonecenter.asm"
INCLUDE "data/wildPokemon/safarizone1.asm"
INCLUDE "data/wildPokemon/safarizone2.asm"
INCLUDE "data/wildPokemon/safarizone3.asm"
-INCLUDE "data/wildPokemon/waterpokemon.asm"
+INCLUDE "data/wildPokemon/route19.asm"
+INCLUDE "data/wildPokemon/route20.asm"
INCLUDE "data/wildPokemon/seafoamisland1.asm"
INCLUDE "data/wildPokemon/seafoamislandb1.asm"
INCLUDE "data/wildPokemon/seafoamislandb2.asm"
diff --git a/docs/bugs_and_glitches.md b/docs/bugs_and_glitches.md
new file mode 100644
index 00000000..a82a52a8
--- /dev/null
+++ b/docs/bugs_and_glitches.md
@@ -0,0 +1,59 @@
+# 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/menu/options.asm](/engine/menu/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_follow.asm#1165](/engine/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/HoF_room_pc.asm b/engine/HoF_room_pc.asm
index 7e08631c..c070e8c8 100755
--- a/engine/HoF_room_pc.asm
+++ b/engine/HoF_room_pc.asm
@@ -1,140 +1,130 @@
HallOfFamePC:
- callba AnimateHallOfFame
+ callab FallingStarEnd
call ClearScreen
ld c, 100
call DelayFrames
+
call DisableLCD
- ld hl, vFont
- ld bc, $800 / 2
- call ZeroMemory
- ld hl, vChars2 + $600
- ld bc, $200 / 2
- call ZeroMemory
- ld hl, vChars2 + $7e0
- ld bc, $10
- ld a, $ff
- call FillMemory
+ ld a, $a7
+ ld [rWX], a
+ xor a
+ ld [rSCX], a
+ ld [rSCY], a
+ ld [hSCX], a
+ ld [hSCY], a
+ ld [hWY], a
+ ld [rWY], a
+ call CreditsLoadFont
coord hl, 0, 0
call FillFourRowsWithBlack
coord hl, 0, 14
call FillFourRowsWithBlack
ld a, %11000000
ld [rBGP], a
+ call UpdateGBCPal_BGP
call EnableLCD
- ld a, $ff
- 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
+ ld [H_AUTOBGTRANSFERENABLED], a
ld hl, HoFGBPalettes
ld b, 4
.loop
ld a, [hli]
ld [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
ld [H_AUTOBGTRANSFERENABLED], 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
- coord hl, 8, 6
- call GetMonHeader
- call LoadFrontSpriteByMonIndex
- ld hl, vBGMap0 + $c
+ call GetNextCreditsMon
+ ld hl, vBGMap0 + 12
call CreditsCopyTileMapToVRAM
xor a
ld [H_AUTOBGTRANSFERENABLED], a
- call LoadScreenTilesFromBuffer1
+ call LoadScreenTilesFromBuffer2DisableBGTransfer
ld hl, vBGMap0
call CreditsCopyTileMapToVRAM
- ld a, $A7
- ld [rWX], a
- ld hl, vBGMap1
- call CreditsCopyTileMapToVRAM
- call FillMiddleOfScreenWithWhite
ld a, %11111100 ; make the mon a black silhouette
ld [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
+ ld [H_AUTOBGTRANSFERENABLED], 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
- ld a, [rWX]
- sub 8
- ld [rWX], a
- dec c
- jr nz, .scrollLoop2
-
- xor a
- ld [hWY], a
ld a, %11000000
ld [rBGP], a
+ call UpdateGBCPal_BGP
+ xor a
+ ld [hSCX], a
ret
-INCLUDE "data/credit_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
+ ld [hSCX], a
+ add 8
ld b, a
+ call DelayFrame
+ dec c
+ jr nz, ScrollCreditsMonLeft
ret
-ScrollCreditsMonLeft_SetSCX:
- ld a, [rLY]
- cp l
- jr nz, ScrollCreditsMonLeft_SetSCX
- ld a, h
- ld [rSCX], a
-.loop
- ld 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
+ coord hl, 8, 6
+ call GetMonHeader
+ call LoadFrontSpriteByMonIndex
ret
-HoFGBPalettes:
- db %11000000
- db %11010000
- db %11100000
- db %11110000
+INCLUDE "data/credit_mons.asm"
CreditsCopyTileMapToVRAM:
ld a, l
@@ -145,6 +135,23 @@ CreditsCopyTileMapToVRAM:
ld [H_AUTOBGTRANSFERENABLED], a
jp Delay3
+CreditsLoadFont:
+ call LoadFontTilePatterns
+ ld hl, vChars1
+ ld bc, $40 * $10
+ call ZeroMemory
+
+ call LoadTextBoxTilePatterns
+ ld hl, vChars2 + $60 * $10
+ ld bc, $10 * $10
+ call ZeroMemory
+
+ ld hl, vChars2 + $7e * $10
+ ld bc, $1 * $10
+ ld a, $ff
+ call FillMemory
+ ret
+
ZeroMemory:
; zero bc bytes at hl
ld [hl], 0
@@ -167,7 +174,40 @@ FillMiddleOfScreenWithWhite:
ld a, " "
jp FillMemory
-Credits:
+FillLeftHalfOfScreenWithWhite:
+ coord hl, 0, 4
+ push bc
+ call FillHalfOfScreenWithWhite
+ pop bc
+ ret
+
+FillRightHalfOfScreenWithWhite:
+ coord hl, 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,48 @@ Credits:
jr z, .showCopyrightText
cp $fa
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, $ff
- pop hl
- add hl, bc
- call PlaceString
- pop hl
- ld bc, SCREEN_WIDTH * 2
- add hl, bc
+ call PlaceCreditsText
+ pop de
+ jr .nextCreditsCommand
+
+.showCopyrightText
+ callba 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
- callba 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 + $600
lb bc, BANK(TheEndGfx), (TheEndGfxEnd - TheEndGfx) / $10
@@ -258,8 +288,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, $ff
+ add hl, bc
+ call PlaceString
+ pop hl
+ ld bc, SCREEN_WIDTH * 2
+ add hl, bc
+ ret
INCLUDE "data/credits_order.asm"
diff --git a/engine/add_mon.asm b/engine/add_mon.asm
index b2feeb12..40b776d4 100644
--- a/engine/add_mon.asm
+++ b/engine/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, .skipGivingTwistedSpoon
+ ld a, $60 ; twistedspoon in gen 2
+ ld [de], a
+.skipGivingTwistedSpoon
ld hl, wMonHMoves
ld a, [hli]
inc de
diff --git a/engine/animated_objects_3e.asm b/engine/animated_objects_3e.asm
new file mode 100755
index 00000000..2373e19e
--- /dev/null
+++ b/engine/animated_objects_3e.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, wOAMBuffer / $100
+.deinit_unused_oam_loop
+ ld a, l
+ cp wOAMBufferEnd % $100
+ 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, wOAMBuffer / $100
+ 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 wOAMBufferEnd % $100
+ 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/bank30.bin b/engine/bank30.bin
new file mode 100644
index 00000000..6309c149
--- /dev/null
+++ b/engine/bank30.bin
Binary files differ
diff --git a/engine/bank3c.asm b/engine/bank3c.asm
new file mode 100644
index 00000000..9c0e281f
--- /dev/null
+++ b/engine/bank3c.asm
@@ -0,0 +1,189 @@
+INCLUDE "engine/pikachu_pcm.asm"
+INCLUDE "engine/overworld/advance_player_sprite.asm"
+
+INCLUDE "engine/black_out.asm"
+
+SetMapSpecificScriptFlagsOnMapReload:
+ ld a, [wCurMap]
+ cp VERMILION_GYM ; ??? new thing about verm gym?
+ jr z, .verm_gym
+ ld c, a
+ ld hl, .MapList
+.search_loop
+ ld a, [hli]
+ cp c
+ jr z, .in_list
+ cp a, $ff
+ jr nz, .search_loop
+ ret
+
+.verm_gym
+ ld hl, wCurrentMapScriptFlags
+ set 6, [hl]
+ ret
+
+.in_list
+ ld hl, wCurrentMapScriptFlags
+ set 5, [hl]
+ ret
+
+.MapList
+ 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 $ff
+
+BeachHouse_GFX:
+ INCBIN "gfx/tilesets/beachhouse.2bpp"
+ ds 384
+
+BeachHouse_Block:
+ INCBIN "gfx/blocksets/beachhouse.bst"
+
+Func_f0a54:
+ ret
+
+LoadUnusedBluesHouseMissableObjectData:
+; referenced in an unused function
+ ld hl, .MissableObjectsMaps
+.loop
+ ld a, [hli]
+ cp a, $ff
+ 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
+
+.MissableObjectsMaps:
+ dbbw BLUES_HOUSE, .End - .Start, .Start
+ db $ff
+
+.Start:
+ db 1, HS_DAISY_SITTING_COPY
+ db 2, HS_DAISY_WALKING_COPY
+ db 3, HS_TOWN_MAP_COPY
+ db $ff
+.End:
+
+TryApplyPikachuMovementData:
+ ld a, [wd472]
+ bit 7, a
+ ret z
+ ld a, [wWalkBikeSurfState]
+ and a
+ ret nz
+ push hl
+ push bc
+ callab 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
+ callab LoadPikachuShadowIntoVRAM
+ pop af
+ ld [wUpdateSpritesEnabled], a
+ pop hl
+ call ApplyPikachuMovementData
+ callab RefreshPikachuFollow
+ ret
+
+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"
+
+PokecenterChanseyText:
+ ld hl, NurseChanseyText
+ call PrintText
+ ld a, CHANSEY
+ call PlayCry
+ call WaitForSoundToFinish
+ ret
+
+NurseChanseyText:
+ TX_FAR _NurseChanseyText
+ db "@"
+
+INCLUDE "engine/HoF_room_pc.asm"
+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/mapHeaders/BeachHouse.asm"
+INCLUDE "scripts/BeachHouse.asm"
+BeachHouse_Blocks:
+INCBIN "maps/BeachHouse.blk"
+INCLUDE "data/mapObjects/BeachHouse.asm"
+
+INCLUDE "scripts/BeachHouse2.asm"
+INCLUDE "scripts/BillsHouse2.asm"
+INCLUDE "scripts/ViridianForest2.asm"
+INCLUDE "scripts/SSAnne2FRooms_2.asm"
+INCLUDE "scripts/SilphCo11F_2.asm"
+
+INCLUDE "engine/overworld/hidden_objects.asm"
+INCLUDE "engine/vermilion_gym_trash_cans.asm"
diff --git a/engine/bank3d.asm b/engine/bank3d.asm
new file mode 100644
index 00000000..0cfdea08
--- /dev/null
+++ b/engine/bank3d.asm
@@ -0,0 +1,495 @@
+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"
+
+StarterPikachuBattleEntranceAnimation:
+ coord hl, 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
+
+INCLUDE "engine/battle/decrement_pp.asm"
+
+ModifyPikachuHappiness::
+ ld a, d
+ cp PIKAHAPPY_GYMLEADER
+ jr z, .checkanywhereinparty
+ cp PIKAHAPPY_WALKING
+ jr z, .checkanywhereinparty
+ push de
+ callab IsThisPartymonStarterPikachu_Party
+ pop de
+ ret nc
+ jr .proceed
+
+.checkanywhereinparty
+ push de
+ callab 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 ; Unknown (d = 10)
+ db -10, -10, -20 ; Unknown (d = 11)
+
+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)
+
+RedPicBack: INCBIN "pic/trainer/redb.pic"
+OldManPic: INCBIN "pic/trainer/oldman.pic"
+ProfOakPicBack: INCBIN "pic/ytrainer/prof.oakb.pic"
+
+LoadYellowTitleScreenGFX:
+ ld hl, PokemonLogoGraphics
+ ld de, vChars2
+ ld bc, 115 * $10
+ ld a, BANK(PokemonLogoGraphics) ; redundant because this function is in bank3d
+ call FarCopyData
+ ld hl, YellowLogoGraphics + 35 * $10
+ ld de, vChars0 + 253 * $10
+ ld bc, 3 * $10
+ ld a, BANK(YellowLogoGraphics)
+ call FarCopyData
+ ld hl, YellowLogoGraphics + 38 * $10
+ ld de, vChars1
+ ld bc, 64 * $10
+ ld a, BANK(YellowLogoGraphics)
+ call FarCopyData
+ ld hl, YellowLogoGraphics + 102 * $10
+ ld de, vChars0 + 240 * $10
+ ld bc, 12 * $10
+ ld a, BANK(YellowLogoGraphics)
+ call FarCopyData
+ ret
+
+TitleScreen_PlacePokemonLogo:
+ coord hl, 2, 1
+ ld de, TitleScreenPokemonLogoTilemap
+ lb bc, 7, 16
+ call Bank3D_CopyBox
+ ret
+
+TitleScreen_PlacePikaSpeechBubble:
+ coord hl, 6, 4
+ ld de, TitleScreenPikaBubbleTilemap
+ lb bc, 4, 7
+ call Bank3D_CopyBox
+ coord hl, 9, 8
+ ld [hl], $64
+ inc hl
+ ld [hl], $65
+ ret
+
+TitleScreen_PlacePikachu:
+ coord hl, 4, 8
+ ld de, TitleScreenPikachuTilemap
+ lb bc, 9, 12
+ call Bank3D_CopyBox
+ coord hl, 16, 10
+ ld [hl], $96
+ coord hl, 16, 11
+ ld [hl], $9d
+ coord hl, 16, 12
+ ld [hl], $a7
+ coord hl, 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 (xy)
+ db $f4, $f4, $f4, $f4, $f4, $f4, $49, $f4, $72, $30, $f4, $f4, $f4, $f4, $f4, $f4
+ db $fd, $01, $02, $03, $04, $05, $06, $07, $08, $09, $0a, $0b, $f4, $0d, $0e, $0f
+ db $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $1a, $1b, $1c, $1d, $1e, $1f
+ db $20, $21, $22, $23, $24, $25, $26, $27, $28, $29, $2a, $2b, $2c, $2d, $2e, $2f
+ db $f4, $31, $32, $33, $34, $35, $36, $37, $38, $39, $3a, $3b, $3c, $3d, $3e, $3f
+ db $f4, $41, $42, $43, $44, $45, $46, $47, $48, $f4, $4a, $4b, $4c, $4d, $4e, $4f
+ db $f4, $6a, $6b, $6c, $6d, $f4, $f4, $f4, $f4, $f4, $f4, $6e, $6f, $70, $71, $f4
+
+Pointer_f4669:
+; Unreferenced
+ db $47, $48, $49, $4a, $4b, $4c, $4d, $4e, $4f, $5f
+
+TitleScreenPikaBubbleTilemap:
+; 7x4 (xy)
+ db $24, $25, $66, $67, $68, $69, $2a
+ db $50, $51, $52, $53, $54, $55, $56
+ db $57, $58, $59, $5a, $5b, $5c, $5d
+ db $6d, $5e, $5f, $60, $61, $62, $63
+
+TitleScreenPikachuTilemap:
+; 12x9 (xy)
+ db $80, $81, $82, $83, $00, $00, $00, $00, $84, $85, $86, $87
+ db $88, $89, $8a, $8b, $8c, $8d, $8d, $8e, $8f, $8a, $90, $91
+ db $00, $92, $93, $8a, $8a, $8a, $8a, $8a, $8a, $94, $95, $00
+ db $00, $00, $97, $8a, $8a, $98, $99, $8a, $8a, $9a, $9b, $9c
+ db $00, $00, $9e, $9f, $a0, $a1, $a2, $a3, $a4, $a5, $a6, $8a
+ db $00, $a8, $a9, $aa, $8a, $ab, $ac, $8a, $ad, $ae, $af, $b0
+ db $00, $b2, $b3, $b4, $8a, $8a, $8a, $8a, $b5, $b6, $b7, $b8
+ db $00, $b9, $ba, $8a, $8a, $8a, $8a, $8a, $8a, $bb, $bc, $00
+ db $00, $00, $bd, $8a, $8a, $8a, $8a, $8a, $8a, $be, $bf, $00
+
+PokemonLogoGraphics: INCBIN "gfx/pokemon_logo.2bpp"
+PokemonLogoGraphicsEnd:
+YellowLogoGraphics: INCBIN "gfx/yellow_titlescreen.2bpp"
+YellowLogoGraphicsEnd:
+
+INCLUDE "engine/menu/link_menu.asm"
+
+HandleMenuInputDouble:
+ xor a
+ ld [wPartyMenuAnimMonEnabled], a
+
+HandleMenuInputPokemonSelectionDouble:
+ ld a, [H_DOWNARROWBLINKCNT1]
+ push af
+ ld a, [H_DOWNARROWBLINKCNT2]
+ push af ; save existing values on stack
+ xor a
+ ld [H_DOWNARROWBLINKCNT1], a ; blinking down arrow timing value 1
+ ld a, $06
+ ld [H_DOWNARROWBLINKCNT2], a ; blinking down arrow timing value 2
+.loop1
+ xor a
+ ld [wAnimCounter], a ; counter for pokemon shaking animation
+ call .UpdateCursorTile
+ call JoypadLowSensitivity
+ ld a, [hJoy5]
+ and a ; was a key pressed?
+ jr nz, .keyPressed
+ pop af
+ ld [H_DOWNARROWBLINKCNT2], a
+ pop af
+ ld [H_DOWNARROWBLINKCNT1], a ; restore previous values
+ xor a
+ ld [wMenuWrappingEnabled], a ; disable menu wrapping
+ ret
+.keyPressed
+ xor a
+ ld [wCheckFor180DegreeTurn], a
+ ld 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
+ ld a, [hJoy5]
+ and A_BUTTON | B_BUTTON
+ jr z, .skipPlayingSound
+.AButtonOrBButtonPressed
+ ld a, SFX_PRESS_AB
+ call PlaySound ; play sound
+.skipPlayingSound
+ pop af
+ ld [H_DOWNARROWBLINKCNT2], a
+ pop af
+ ld [H_DOWNARROWBLINKCNT1], a ; restore previous values
+ ld a, [hJoy5]
+ ret
+
+.UpdateCursorTile:
+ ld a, [wTopMenuItemY]
+ and a
+ jr z, .asm_f5ac0
+ coord hl, 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
+
+INCLUDE "engine/overworld/field_move_messages.asm"
+
+INCLUDE "engine/items/inventory.asm"
+
+TrainerInfoTextBoxTileGraphics: INCBIN "gfx/trainer_info.2bpp"
+TrainerInfoTextBoxTileGraphicsEnd:
+BlankLeaderNames: INCBIN "gfx/blank_leader_names.2bpp"
+CircleTile: INCBIN "gfx/circle_tile.2bpp"
+BadgeNumbersTileGraphics: INCBIN "gfx/badge_numbers.2bpp"
+
+ReadSuperRodData:
+ ld a, [wCurMap]
+ ld c, a
+ ld hl, FishingSlots
+.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/super_rod.asm"
+INCLUDE "engine/battle/bank3d_battle.asm"
+INCLUDE "engine/items/tm_prices.asm"
+INCLUDE "engine/multiply_divide.asm"
+INCLUDE "engine/give_pokemon.asm"
+INCLUDE "engine/battle/get_trainer_name.asm"
+INCLUDE "engine/random.asm"
+INCLUDE "engine/predefs.asm"
diff --git a/engine/bank3e.asm b/engine/bank3e.asm
new file mode 100644
index 00000000..32f5ebfd
--- /dev/null
+++ b/engine/bank3e.asm
@@ -0,0 +1,5 @@
+INCLUDE "engine/surfing_minigame.asm"
+INCLUDE "engine/yellow_intro.asm"
+INCLUDE "data/animated_objects_3e_2.asm"
+YellowIntroGraphics: INCBIN "gfx/yellow_intro.2bpp"
+INCLUDE "engine/animated_objects_3e.asm"
diff --git a/engine/bank3f.asm b/engine/bank3f.asm
new file mode 100644
index 00000000..23eadbb1
--- /dev/null
+++ b/engine/bank3f.asm
@@ -0,0 +1,23 @@
+INCLUDE "data/map_songs.asm"
+INCLUDE "data/map_header_pointers.asm"
+INCLUDE "data/map_header_banks.asm"
+INCLUDE "engine/pikachu_follow.asm"
+INCLUDE "engine/pikachu_status.asm"
+INCLUDE "engine/pikachu_emotions.asm"
+INCLUDE "engine/pikachu_movement.asm"
+INCLUDE "engine/pikachu_pic_animation.asm"
+
+Func_fe66e:
+ ret
+
+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"
+Clefairy2Sprite: INCBIN "gfx/sprites/clefairy2.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/engine/battle/animations.asm b/engine/battle/animations.asm
index 74e48535..de1e67b9 100755
--- 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 ; 1
@@ -46,13 +48,22 @@ DrawFrameBlock:
.finishCopying ; finish copying values to OAM (when [wSubAnimTransform] not 1 or 2)
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]
- add $31 ; base tile ID for battle animations
+ add a, $31 ; base tile ID for battle animations
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,10 +82,16 @@ 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]
- add $31 ; base tile ID for battle animations
+ add a, $31 ; base tile ID for battle animations
ld [de], a ; store tile ID
inc de
; toggle horizontal and vertical flip
@@ -82,15 +99,16 @@ DrawFrameBlock:
and a
ld b, OAM_VFLIP | OAM_HFLIP
jr z, .storeFlags1
- cp OAM_HFLIP
+ cp a, OAM_HFLIP
ld b, OAM_VFLIP
jr z, .storeFlags1
- cp OAM_VFLIP
+ cp a, OAM_VFLIP
ld b, OAM_HFLIP
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]
ld [rOBP0], a
+ call UpdateGBCPal_OBP0
call LoadAnimationTileset
call LoadSubanimation
call PlaySubanimation
pop af
ld [rOBP0], a
+ call UpdateGBCPal_OBP0
.nextAnimationCommand
pop hl
jr .animationLoop
@@ -367,12 +396,7 @@ AnimationTileset2:
INCBIN "gfx/attack_anim_2.2bpp"
SlotMachineTiles2:
-IF DEF(_RED)
- INCBIN "gfx/red/slotmachine2.2bpp"
-ENDC
-IF DEF(_BLUE)
- INCBIN "gfx/blue/slotmachine2.2bpp"
-ENDC
+ INCBIN "gfx/slotmachine2.2bpp"
MoveAnimation:
push hl
@@ -537,6 +561,8 @@ SetAnimationPalette:
ld [rOBP0], a
ld a, $6c
ld [rOBP1], a
+ call UpdateGBCPal_OBP0
+ call UpdateGBCPal_OBP1
ret
.notSGB
ld a, $e4
@@ -544,6 +570,28 @@ SetAnimationPalette:
ld [rOBP0], a
ld a, $6c
ld [rOBP1], a
+ call UpdateGBCPal_OBP0
+ call UpdateGBCPal_OBP1
+ ret
+
+Func_78e98:
+ call SaveScreenTilesToBuffer2
+ xor a
+ ld [H_AUTOBGTRANSFERENABLED], a
+ call ClearScreen
+ ld h, vBGMap0 / $100
+ call WriteLowerByteOfBGMapAndEnableBGTransfer
+ call Delay3
+ xor a
+ ld [H_AUTOBGTRANSFERENABLED], a
+ call LoadScreenTilesFromBuffer2
+ ld h, vBGMap1 / $100
+
+WriteLowerByteOfBGMapAndEnableBGTransfer:
+ ld l, vBGMap0 & $ff
+ call BattleAnimCopyTileMapToVRAM
+ ld a, $1
+ ld [H_AUTOBGTRANSFERENABLED], a
ret
PlaySubanimation:
@@ -691,7 +739,7 @@ AnimationIdSpecialEffects:
dw DoExplodeSpecialEffects
db SPORE
- dw AnimationFlashScreen
+ dw FlashScreenEveryFourFrameBlocks
db EXPLOSION
dw DoExplodeSpecialEffects
@@ -733,6 +781,7 @@ DoBallTossSpecialEffects:
ld a, [rOBP0]
xor %00111100 ; complement colors 1 and 2
ld [rOBP0], a
+ call UpdateGBCPal_OBP0
.skipFlashingEffect
ld a, [wSubAnimCounter]
cp 11 ; is it the beginning of the subanimation?
@@ -922,7 +971,7 @@ TradeShakePokeball:
jp PlaySound
BallMoveDistances1:
- db -12,-12,-8
+ db -12, -12, -8
db $ff ; terminator
; function to make the pokeball jump up
@@ -963,7 +1012,7 @@ TradeJumpPokeball:
jr .loop
BallMoveDistances2:
- db 11,12,-12,-7,7,12,-8,8
+ db 11, 12, -12, -7, 7, 12, -8, 8
db $ff ; terminator
; this function copies the current musical note graphic
@@ -1102,6 +1151,7 @@ AnimationFlashScreenLong:
cp $01 ; is it the end of the palettes?
jr z, .endOfPalettes
ld [rBGP], a
+ call UpdateGBCPal_BGP
call FlashScreenLongDelay
jr .innerLoop
.endOfPalettes
@@ -1164,14 +1214,17 @@ AnimationFlashScreen:
push af ; save initial palette
ld a, %00011011 ; 0, 1, 2, 3 (inverted colors)
ld [rBGP], a
+ call UpdateGBCPal_BGP
ld c, 2
call DelayFrames
xor a ; white out background
ld [rBGP], a
+ call UpdateGBCPal_BGP
ld c, 2
call DelayFrames
pop af
ld [rBGP], a ; restore initial palette
+ call UpdateGBCPal_BGP
ret
AnimationDarkScreenPalette:
@@ -1217,6 +1270,7 @@ SetAnimationBGPalette:
ld a, c
.next
ld [rBGP], a
+ call UpdateGBCPal_BGP
ret
ld b, $5
@@ -1261,15 +1315,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
@@ -1412,16 +1481,30 @@ BattleAnimWriteOAMEntry:
; Y coordinate = e (increased by 8 each call, before the write to OAM)
; X coordinate = [wBaseCoordX]
; tile = d
-; attributes = 0
+; attributes = variable (dependant 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
@@ -1473,7 +1556,7 @@ AdjustOAMBlockYPos2:
ret
AnimationBlinkEnemyMon:
-; Make the enemy mon's sprite blink on and off for a second or two
+ ; Make the enemy mon's sprite blink on and off for a second or two
ld hl, AnimationBlinkMon
jp CallWithTurnFlipped
@@ -1626,6 +1709,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
@@ -1634,9 +1719,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
@@ -1938,7 +2034,7 @@ _AnimationSlideMonOff:
jr nz, .slideLoop
ret
-; Since mon pic tile numbers go from top to bottom, left to right in order,
+; Since mon pic tile numbers go from top to bottom, left to right in order,
; adding the height of the mon pic in tiles to a tile number gives the tile
; number of the tile one column to the right (and thus subtracting the height
; gives the reverse). If the next tile would be past the edge of the pic, the 2
@@ -1948,10 +2044,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
@@ -2088,18 +2182,24 @@ AnimationSubstitute:
CopySlowbroSpriteData:
ld bc, $0010
ld a, BANK(SlowbroSprite)
- jp FarCopyData2
+ jp FarCopyData
HideSubstituteShowMonAnim:
ld a, [H_WHOSETURN]
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
@@ -2108,12 +2208,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
+ ld a, [H_WHOSETURN]
+ 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
@@ -2181,6 +2334,23 @@ AnimationHideEnemyMonPic:
ld [H_AUTOBGTRANSFERENABLED], a
jp Delay3
+Func_79929:
+ ld hl, wPlayerMonMinimized
+ ld a, [H_WHOSETURN]
+ 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.
@@ -2202,6 +2372,8 @@ InitMultipleObjectsOAM:
jr nz, .loop
ret
+ ret ; unreferenced
+
AnimationHideMonPic:
; Hides the mon's sprite.
ld a, [H_WHOSETURN]
@@ -2228,7 +2400,7 @@ ClearMonPicFromTileMap:
ret
; puts the tile map destination address of a mon sprite in hl, given the row count in b
-; The usual row count is 7, but it may be smaller when sliding a mon sprite in/out,
+; The usual row count is 7, but it may be smaller when sliding a mon sprite in/out,
; in order to show only a portion of the mon sprite.
GetMonSpriteTileMapPointerFromRowCount:
push de
@@ -2364,172 +2536,172 @@ IsCryMove:
MoveSoundTable:
; ID, pitch mod, tempo mod
- db SFX_POUND, $00,$80 ; POUND
- db SFX_BATTLE_0C, $10,$80 ; KARATE_CHOP
- db SFX_DOUBLESLAP, $00,$80 ; DOUBLESLAP
- db SFX_BATTLE_0B, $01,$80 ; COMET_PUNCH
- db SFX_BATTLE_0D, $00,$40 ; MEGA_PUNCH
- db SFX_SILPH_SCOPE, $00,$ff ; PAY_DAY
- db SFX_BATTLE_0D, $10,$60 ; FIRE_PUNCH
- db SFX_BATTLE_0D, $20,$80 ; ICE_PUNCH
- db SFX_BATTLE_0D, $00,$a0 ; THUNDERPUNCH
- db SFX_DAMAGE, $00,$80 ; SCRATCH
- db SFX_BATTLE_0F, $20,$40 ; VICEGRIP
- db SFX_BATTLE_0F, $00,$80 ; GUILLOTINE
- db SFX_BATTLE_0E, $00,$a0 ; RAZOR_WIND
- db SFX_NOT_VERY_EFFECTIVE,$10,$c0 ; SWORDS_DANCE
- db SFX_NOT_VERY_EFFECTIVE,$00,$a0 ; CUT
- db SFX_BATTLE_12, $00,$c0 ; GUST
- db SFX_BATTLE_12, $10,$a0 ; WING_ATTACK
- db SFX_BATTLE_13, $00,$e0 ; WHIRLWIND
- db SFX_NOT_VERY_EFFECTIVE,$20,$c0 ; FLY
- db SFX_BATTLE_14, $00,$80 ; BIND
- db SFX_BATTLE_22, $00,$80 ; SLAM
- db SFX_VINE_WHIP, $01,$80 ; VINE_WHIP
- db SFX_BATTLE_20, $00,$80 ; STOMP
- db SFX_BATTLE_17, $f0,$40 ; DOUBLE_KICK
- db SFX_SUPER_EFFECTIVE, $00,$80 ; MEGA_KICK
- db SFX_BATTLE_17, $00,$80 ; JUMP_KICK
- db SFX_BATTLE_21, $10,$80 ; ROLLING_KICK
- db SFX_BATTLE_1B, $01,$a0 ; SAND_ATTACK
- db SFX_BATTLE_18, $00,$80 ; HEADBUTT
- db SFX_BATTLE_1E, $00,$60 ; HORN_ATTACK
- db SFX_BATTLE_1E, $01,$40 ; FURY_ATTACK
- db SFX_HORN_DRILL, $00,$a0 ; HORN_DRILL
- db SFX_SUPER_EFFECTIVE, $10,$a0 ; TACKLE
- db SFX_BATTLE_20, $00,$c0 ; BODY_SLAM
- db SFX_BATTLE_14, $10,$60 ; WRAP
- db SFX_SUPER_EFFECTIVE, $00,$a0 ; TAKE_DOWN
- db SFX_BATTLE_22, $11,$c0 ; THRASH
- db SFX_SUPER_EFFECTIVE, $20,$c0 ; DOUBLE_EDGE
- db SFX_BATTLE_21, $00,$80 ; TAIL_WHIP
- db SFX_BATTLE_1B, $00,$80 ; POISON_STING
- db SFX_BATTLE_1B, $20,$c0 ; TWINEEDLE
- db SFX_BATTLE_19, $00,$80 ; PIN_MISSILE
- db SFX_BATTLE_31, $ff,$40 ; LEER
- db SFX_BATTLE_1E, $00,$80 ; BITE
- db SFX_BATTLE_0B, $00,$c0 ; GROWL
- db SFX_BATTLE_0B, $00,$40 ; ROAR
- db SFX_BATTLE_35, $00,$80 ; SING
- db SFX_BATTLE_27, $40,$60 ; SUPERSONIC
- db SFX_BATTLE_27, $00,$80 ; SONICBOOM
- db SFX_BATTLE_27, $ff,$40 ; DISABLE
- db SFX_BATTLE_2A, $80,$c0 ; ACID
- db SFX_BATTLE_19, $10,$a0 ; EMBER
- db SFX_BATTLE_19, $21,$e0 ; FLAMETHROWER
- db SFX_BATTLE_29, $00,$80 ; MIST
- db SFX_BATTLE_24, $20,$60 ; WATER_GUN
- db SFX_BATTLE_2A, $00,$80 ; HYDRO_PUMP
- db SFX_BATTLE_2C, $00,$80 ; SURF
- db SFX_BATTLE_28, $40,$80 ; ICE_BEAM
- db SFX_BATTLE_29, $f0,$e0 ; BLIZZARD
- db SFX_PSYBEAM, $00,$80 ; PSYBEAM
- db SFX_BATTLE_2A, $f0,$60 ; BUBBLEBEAM
- db SFX_BATTLE_28, $00,$80 ; AURORA_BEAM
- db SFX_BATTLE_36, $00,$80 ; HYPER_BEAM
- db SFX_PECK,$01, $a0 ; PECK
- db SFX_BATTLE_13, $f0,$20 ; DRILL_PECK
- db SFX_BATTLE_23, $01,$c0 ; SUBMISSION
- db SFX_BATTLE_23, $00,$80 ; LOW_KICK
- db SFX_SUPER_EFFECTIVE, $00,$e0 ; COUNTER
- db SFX_BATTLE_26, $01,$60 ; SEISMIC_TOSS
- db SFX_BATTLE_26, $20,$40 ; STRENGTH
- db SFX_BATTLE_24, $00,$80 ; ABSORB
- db SFX_BATTLE_24, $40,$c0 ; MEGA_DRAIN
- db SFX_BATTLE_1B, $03,$60 ; LEECH_SEED
- db SFX_BATTLE_25, $11,$e0 ; GROWTH
- db SFX_BATTLE_12, $20,$e0 ; RAZOR_LEAF
- db SFX_BATTLE_2E, $00,$80 ; SOLARBEAM
- db SFX_BATTLE_1C, $00,$80 ; POISONPOWDER
- db SFX_BATTLE_1C, $11,$a0 ; STUN_SPORE
- db SFX_BATTLE_1C, $01,$c0 ; SLEEP_POWDER
- db SFX_BATTLE_13, $14,$c0 ; PETAL_DANCE
- db SFX_BATTLE_1B, $02,$a0 ; STRING_SHOT
- db SFX_BATTLE_29, $f0,$80 ; DRAGON_RAGE
- db SFX_BATTLE_29, $20,$c0 ; FIRE_SPIN
- db SFX_BATTLE_2F, $00,$20 ; THUNDERSHOCK
- db SFX_BATTLE_2F, $20,$80 ; THUNDERBOLT
- db SFX_BATTLE_2E, $12,$60 ; THUNDER_WAVE
- db SFX_BATTLE_26, $00,$80 ; THUNDER
- db SFX_BATTLE_14, $01,$e0 ; ROCK_THROW
- db SFX_BATTLE_29, $0f,$e0 ; EARTHQUAKE
- db SFX_BATTLE_29, $11,$20 ; FISSURE
- db SFX_DAMAGE, $10,$40 ; DIG
- db SFX_BATTLE_0F, $10,$c0 ; TOXIC
- db SFX_BATTLE_14, $00,$20 ; CONFUSION
- db SFX_PSYCHIC_M, $00,$80 ; PSYCHIC_M
- db SFX_BATTLE_35, $11,$18 ; HYPNOSIS
- db SFX_BATTLE_09, $20,$c0 ; MEDITATE
- db SFX_FAINT_FALL, $20,$c0 ; AGILITY
- db SFX_BATTLE_25, $00,$10 ; QUICK_ATTACK
- db SFX_BATTLE_26, $f0,$20 ; RAGE
- db SFX_BATTLE_33, $f0,$c0 ; TELEPORT
- db SFX_NOT_VERY_EFFECTIVE,$f0,$e0 ; NIGHT_SHADE
- db SFX_BATTLE_09, $f0,$40 ; MIMIC
- db SFX_BATTLE_31, $00,$80 ; SCREECH
- db SFX_BATTLE_33, $80,$40 ; DOUBLE_TEAM
- db SFX_BATTLE_33, $00,$80 ; RECOVER
- db SFX_BATTLE_14, $11,$20 ; HARDEN
- db SFX_BATTLE_14, $22,$10 ; MINIMIZE
- db SFX_BATTLE_1B, $f1,$ff ; SMOKESCREEN
- db SFX_BATTLE_13, $f1,$ff ; CONFUSE_RAY
- db SFX_BATTLE_14, $33,$30 ; WITHDRAW
- db SFX_BATTLE_32, $40,$c0 ; DEFENSE_CURL
- db SFX_BATTLE_0E, $20,$20 ; BARRIER
- db SFX_BATTLE_0E, $f0,$10 ; LIGHT_SCREEN
- db SFX_BATTLE_0F, $f8,$10 ; HAZE
- db SFX_NOT_VERY_EFFECTIVE,$f0,$10 ; REFLECT
- db SFX_BATTLE_25, $00,$80 ; FOCUS_ENERGY
- db SFX_BATTLE_18, $00,$c0 ; BIDE
- db SFX_BATTLE_32, $c0,$ff ; METRONOME
- db SFX_BATTLE_09, $f2,$20 ; MIRROR_MOVE
- db SFX_BATTLE_34, $00,$80 ; SELFDESTRUCT
- db SFX_BATTLE_34, $00,$40 ; EGG_BOMB
- db SFX_BATTLE_09, $00,$40 ; LICK
- db SFX_NOT_VERY_EFFECTIVE,$10,$ff ; SMOG
- db SFX_BATTLE_2A, $20,$20 ; SLUDGE
- db SFX_BATTLE_32, $00,$80 ; BONE_CLUB
- db SFX_BATTLE_29, $1f,$20 ; FIRE_BLAST
- db SFX_BATTLE_25, $2f,$80 ; WATERFALL
- db SFX_BATTLE_0F, $1f,$ff ; CLAMP
- db SFX_BATTLE_2B, $1f,$60 ; SWIFT
- db SFX_BATTLE_26, $1e,$20 ; SKULL_BASH
- db SFX_BATTLE_26, $1f,$18 ; SPIKE_CANNON
- db SFX_BATTLE_14, $0f,$80 ; CONSTRICT
- db SFX_BATTLE_09, $f8,$10 ; AMNESIA
- db SFX_FAINT_FALL, $18,$20 ; KINESIS
- db SFX_BATTLE_32, $08,$40 ; SOFTBOILED
- db SFX_BATTLE_17, $01,$e0 ; HI_JUMP_KICK
- db SFX_NOT_VERY_EFFECTIVE,$09,$ff ; GLARE
- db SFX_BATTLE_35, $42,$01 ; DREAM_EATER
- db SFX_BATTLE_1C, $00,$ff ; POISON_GAS
- db SFX_BATTLE_32, $08,$e0 ; BARRAGE
- db SFX_BATTLE_24, $00,$80 ; LEECH_LIFE
- db SFX_BATTLE_09, $88,$10 ; LOVELY_KISS
- db SFX_BATTLE_25, $48,$ff ; SKY_ATTACK
- db SFX_FAINT_FALL, $ff,$ff ; TRANSFORM
- db SFX_BATTLE_24, $ff,$10 ; BUBBLE
- db SFX_FAINT_FALL, $ff,$04 ; DIZZY_PUNCH
- db SFX_BATTLE_1C, $01,$ff ; SPORE
- db SFX_BATTLE_13, $f8,$ff ; FLASH
- db SFX_BATTLE_0C, $f0,$f0 ; PSYWAVE
- db SFX_BATTLE_0F, $08,$10 ; SPLASH
- db SFX_BATTLE_0D, $f0,$ff ; ACID_ARMOR
- db SFX_SUPER_EFFECTIVE, $f0,$ff ; CRABHAMMER
- db SFX_BATTLE_34, $10,$ff ; EXPLOSION
- db SFX_BATTLE_0E, $f0,$20 ; FURY_SWIPES
- db SFX_BATTLE_2B, $f0,$60 ; BONEMERANG
- db SFX_BATTLE_21, $12,$10 ; REST
- db SFX_BATTLE_36, $f0,$20 ; ROCK_SLIDE
- db SFX_BATTLE_1E, $12,$ff ; HYPER_FANG
- db SFX_BATTLE_31, $80,$04 ; SHARPEN
- db SFX_BATTLE_33, $f0,$10 ; CONVERSION
- db SFX_BATTLE_29, $f8,$ff ; TRI_ATTACK
- db SFX_BATTLE_26, $f0,$ff ; SUPER_FANG
- db SFX_NOT_VERY_EFFECTIVE,$01,$ff ; SLASH
- db SFX_BATTLE_2C, $d8,$04 ; SUBSTITUTE
- db SFX_BATTLE_0B, $00,$80 ; STRUGGLE
- db SFX_BATTLE_0B, $00,$80
+ db SFX_POUND, $00, $80 ; POUND
+ db SFX_BATTLE_0C, $10, $80 ; KARATE_CHOP
+ db SFX_DOUBLESLAP, $00, $80 ; DOUBLESLAP
+ db SFX_BATTLE_0B, $01, $80 ; COMET_PUNCH
+ db SFX_BATTLE_0D, $00, $40 ; MEGA_PUNCH
+ db SFX_SILPH_SCOPE, $00, $ff ; PAY_DAY
+ db SFX_BATTLE_0D, $10, $60 ; FIRE_PUNCH
+ db SFX_BATTLE_0D, $20, $80 ; ICE_PUNCH
+ db SFX_BATTLE_0D, $00, $a0 ; THUNDERPUNCH
+ db SFX_DAMAGE, $00, $80 ; SCRATCH
+ db SFX_BATTLE_0F, $20, $40 ; VICEGRIP
+ db SFX_BATTLE_0F, $00, $80 ; GUILLOTINE
+ db SFX_BATTLE_0E, $00, $a0 ; RAZOR_WIND
+ db SFX_NOT_VERY_EFFECTIVE, $10, $c0 ; SWORDS_DANCE
+ db SFX_NOT_VERY_EFFECTIVE, $00, $a0 ; CUT
+ db SFX_BATTLE_12, $00, $c0 ; GUST
+ db SFX_BATTLE_12, $10, $a0 ; WING_ATTACK
+ db SFX_BATTLE_13, $00, $e0 ; WHIRLWIND
+ db SFX_NOT_VERY_EFFECTIVE, $20, $c0 ; FLY
+ db SFX_BATTLE_14, $00, $80 ; BIND
+ db SFX_BATTLE_22, $00, $80 ; SLAM
+ db SFX_VINE_WHIP, $01, $80 ; VINE_WHIP
+ db SFX_BATTLE_20, $00, $80 ; STOMP
+ db SFX_BATTLE_17, $f0, $40 ; DOUBLE_KICK
+ db SFX_SUPER_EFFECTIVE, $00, $80 ; MEGA_KICK
+ db SFX_BATTLE_17, $00, $80 ; JUMP_KICK
+ db SFX_BATTLE_21, $10, $80 ; ROLLING_KICK
+ db SFX_BATTLE_1B, $01, $a0 ; SAND_ATTACK
+ db SFX_BATTLE_18, $00, $80 ; HEADBUTT
+ db SFX_BATTLE_1E, $00, $60 ; HORN_ATTACK
+ db SFX_BATTLE_1E, $01, $40 ; FURY_ATTACK
+ db SFX_HORN_DRILL, $00, $a0 ; HORN_DRILL
+ db SFX_SUPER_EFFECTIVE, $10, $a0 ; TACKLE
+ db SFX_BATTLE_20, $00, $c0 ; BODY_SLAM
+ db SFX_BATTLE_14, $10, $60 ; WRAP
+ db SFX_SUPER_EFFECTIVE, $00, $a0 ; TAKE_DOWN
+ db SFX_BATTLE_22, $11, $c0 ; THRASH
+ db SFX_SUPER_EFFECTIVE, $20, $c0 ; DOUBLE_EDGE
+ db SFX_BATTLE_21, $00, $80 ; TAIL_WHIP
+ db SFX_BATTLE_1B, $00, $80 ; POISON_STING
+ db SFX_BATTLE_1B, $20, $c0 ; TWINEEDLE
+ db SFX_BATTLE_19, $00, $80 ; PIN_MISSILE
+ db SFX_BATTLE_31, $ff, $40 ; LEER
+ db SFX_BATTLE_1E, $00, $80 ; BITE
+ db SFX_BATTLE_0B, $00, $c0 ; GROWL
+ db SFX_BATTLE_0B, $00, $40 ; ROAR
+ db SFX_BATTLE_35, $00, $80 ; SING
+ db SFX_BATTLE_27, $40, $60 ; SUPERSONIC
+ db SFX_BATTLE_27, $00, $80 ; SONICBOOM
+ db SFX_BATTLE_27, $ff, $40 ; DISABLE
+ db SFX_BATTLE_2A, $80, $c0 ; ACID
+ db SFX_BATTLE_19, $10, $a0 ; EMBER
+ db SFX_BATTLE_19, $21, $e0 ; FLAMETHROWER
+ db SFX_BATTLE_29, $00, $80 ; MIST
+ db SFX_BATTLE_24, $20, $60 ; WATER_GUN
+ db SFX_BATTLE_2A, $00, $80 ; HYDRO_PUMP
+ db SFX_BATTLE_2C, $00, $80 ; SURF
+ db SFX_BATTLE_28, $40, $80 ; ICE_BEAM
+ db SFX_BATTLE_29, $f0, $e0 ; BLIZZARD
+ db SFX_PSYBEAM, $00, $80 ; PSYBEAM
+ db SFX_BATTLE_2A, $f0, $60 ; BUBBLEBEAM
+ db SFX_BATTLE_28, $00, $80 ; AURORA_BEAM
+ db SFX_BATTLE_36, $00, $80 ; HYPER_BEAM
+ db SFX_PECK, $01, $a0 ; PECK
+ db SFX_BATTLE_13, $f0, $20 ; DRILL_PECK
+ db SFX_BATTLE_23, $01, $c0 ; SUBMISSION
+ db SFX_BATTLE_23, $00, $80 ; LOW_KICK
+ db SFX_SUPER_EFFECTIVE, $00, $e0 ; COUNTER
+ db SFX_BATTLE_26, $01, $60 ; SEISMIC_TOSS
+ db SFX_BATTLE_26, $20, $40 ; STRENGTH
+ db SFX_BATTLE_24, $00, $80 ; ABSORB
+ db SFX_BATTLE_24, $40, $c0 ; MEGA_DRAIN
+ db SFX_BATTLE_1B, $03, $60 ; LEECH_SEED
+ db SFX_BATTLE_25, $11, $e0 ; GROWTH
+ db SFX_BATTLE_12, $20, $e0 ; RAZOR_LEAF
+ db SFX_BATTLE_2E, $00, $80 ; SOLARBEAM
+ db SFX_BATTLE_1C, $00, $80 ; POISONPOWDER
+ db SFX_BATTLE_1C, $11, $a0 ; STUN_SPORE
+ db SFX_BATTLE_1C, $01, $c0 ; SLEEP_POWDER
+ db SFX_BATTLE_13, $14, $c0 ; PETAL_DANCE
+ db SFX_BATTLE_1B, $02, $a0 ; STRING_SHOT
+ db SFX_BATTLE_29, $f0, $80 ; DRAGON_RAGE
+ db SFX_BATTLE_29, $20, $c0 ; FIRE_SPIN
+ db SFX_BATTLE_2F, $00, $20 ; THUNDERSHOCK
+ db SFX_BATTLE_2F, $20, $80 ; THUNDERBOLT
+ db SFX_BATTLE_2E, $12, $60 ; THUNDER_WAVE
+ db SFX_BATTLE_26, $00, $80 ; THUNDER
+ db SFX_BATTLE_14, $01, $e0 ; ROCK_THROW
+ db SFX_BATTLE_29, $0f, $e0 ; EARTHQUAKE
+ db SFX_BATTLE_29, $11, $20 ; FISSURE
+ db SFX_DAMAGE, $10, $40 ; DIG
+ db SFX_BATTLE_0F, $10, $c0 ; TOXIC
+ db SFX_BATTLE_14, $00, $20 ; CONFUSION
+ db SFX_PSYCHIC_M, $00, $80 ; PSYCHIC_M
+ db SFX_BATTLE_35, $11, $18 ; HYPNOSIS
+ db SFX_BATTLE_09, $20, $c0 ; MEDITATE
+ db SFX_FAINT_FALL, $20, $c0 ; AGILITY
+ db SFX_BATTLE_25, $00, $10 ; QUICK_ATTACK
+ db SFX_BATTLE_26, $f0, $20 ; RAGE
+ db SFX_BATTLE_33, $f0, $c0 ; TELEPORT
+ db SFX_NOT_VERY_EFFECTIVE, $f0, $e0 ; NIGHT_SHADE
+ db SFX_BATTLE_09, $f0, $40 ; MIMIC
+ db SFX_BATTLE_31, $00, $80 ; SCREECH
+ db SFX_BATTLE_33, $80, $40 ; DOUBLE_TEAM
+ db SFX_BATTLE_33, $00, $80 ; RECOVER
+ db SFX_BATTLE_14, $11, $20 ; HARDEN
+ db SFX_BATTLE_14, $22, $10 ; MINIMIZE
+ db SFX_BATTLE_1B, $f1, $ff ; SMOKESCREEN
+ db SFX_BATTLE_13, $f1, $ff ; CONFUSE_RAY
+ db SFX_BATTLE_14, $33, $30 ; WITHDRAW
+ db SFX_BATTLE_32, $40, $c0 ; DEFENSE_CURL
+ db SFX_BATTLE_0E, $20, $20 ; BARRIER
+ db SFX_BATTLE_0E, $f0, $10 ; LIGHT_SCREEN
+ db SFX_BATTLE_0F, $f8, $10 ; HAZE
+ db SFX_NOT_VERY_EFFECTIVE, $f0, $10 ; REFLECT
+ db SFX_BATTLE_25, $00, $80 ; FOCUS_ENERGY
+ db SFX_BATTLE_18, $00, $c0 ; BIDE
+ db SFX_BATTLE_32, $c0, $ff ; METRONOME
+ db SFX_BATTLE_09, $f2, $20 ; MIRROR_MOVE
+ db SFX_BATTLE_34, $00, $80 ; SELFDESTRUCT
+ db SFX_BATTLE_34, $00, $40 ; EGG_BOMB
+ db SFX_BATTLE_09, $00, $40 ; LICK
+ db SFX_NOT_VERY_EFFECTIVE, $10, $ff ; SMOG
+ db SFX_BATTLE_2A, $20, $20 ; SLUDGE
+ db SFX_BATTLE_32, $00, $80 ; BONE_CLUB
+ db SFX_BATTLE_29, $1f, $20 ; FIRE_BLAST
+ db SFX_BATTLE_25, $2f, $80 ; WATERFALL
+ db SFX_BATTLE_0F, $1f, $ff ; CLAMP
+ db SFX_BATTLE_2B, $1f, $60 ; SWIFT
+ db SFX_BATTLE_26, $1e, $20 ; SKULL_BASH
+ db SFX_BATTLE_26, $1f, $18 ; SPIKE_CANNON
+ db SFX_BATTLE_14, $0f, $80 ; CONSTRICT
+ db SFX_BATTLE_09, $f8, $10 ; AMNESIA
+ db SFX_FAINT_FALL, $18, $20 ; KINESIS
+ db SFX_BATTLE_32, $08, $40 ; SOFTBOILED
+ db SFX_BATTLE_17, $01, $e0 ; HI_JUMP_KICK
+ db SFX_NOT_VERY_EFFECTIVE, $09, $ff ; GLARE
+ db SFX_BATTLE_35, $42, $01 ; DREAM_EATER
+ db SFX_BATTLE_1C, $00, $ff ; POISON_GAS
+ db SFX_BATTLE_32, $08, $e0 ; BARRAGE
+ db SFX_BATTLE_24, $00, $80 ; LEECH_LIFE
+ db SFX_BATTLE_09, $88, $10 ; LOVELY_KISS
+ db SFX_BATTLE_25, $48, $ff ; SKY_ATTACK
+ db SFX_FAINT_FALL, $ff, $ff ; TRANSFORM
+ db SFX_BATTLE_24, $ff, $10 ; BUBBLE
+ db SFX_FAINT_FALL, $ff, $04 ; DIZZY_PUNCH
+ db SFX_BATTLE_1C, $01, $ff ; SPORE
+ db SFX_BATTLE_13, $f8, $ff ; FLASH
+ db SFX_BATTLE_0C, $f0, $f0 ; PSYWAVE
+ db SFX_BATTLE_0F, $08, $10 ; SPLASH
+ db SFX_BATTLE_0D, $f0, $ff ; ACID_ARMOR
+ db SFX_SUPER_EFFECTIVE, $f0, $ff ; CRABHAMMER
+ db SFX_BATTLE_34, $10, $ff ; EXPLOSION
+ db SFX_BATTLE_0E, $f0, $20 ; FURY_SWIPES
+ db SFX_BATTLE_2B, $f0, $60 ; BONEMERANG
+ db SFX_BATTLE_21, $12, $10 ; REST
+ db SFX_BATTLE_36, $f0, $20 ; ROCK_SLIDE
+ db SFX_BATTLE_1E, $12, $ff ; HYPER_FANG
+ db SFX_BATTLE_31, $80, $04 ; SHARPEN
+ db SFX_BATTLE_33, $f0, $10 ; CONVERSION
+ db SFX_BATTLE_29, $f8, $ff ; TRI_ATTACK
+ db SFX_BATTLE_26, $f0, $ff ; SUPER_FANG
+ db SFX_NOT_VERY_EFFECTIVE, $01, $ff ; SLASH
+ db SFX_BATTLE_2C, $d8, $04 ; SUBSTITUTE
+ db SFX_BATTLE_0B, $00, $80 ; STRUGGLE
+ db SFX_BATTLE_0B, $00, $80
CopyPicTiles:
ld a, [H_WHOSETURN]
@@ -2587,112 +2759,108 @@ CopyTileIDs:
ret
TileIDListPointerTable:
- dw Unknown_79b24
- dn 7, 7
- dw Unknown_79b55
- dn 5, 7
- dw Unknown_79b78
- dn 3, 7
+ dw DownscaledMonTiles_7x7
+ dn 7, 7
+ dw DownscaledMonTiles_5x7
+ dn 5, 7
+ dw DownscaledMonTiles_3x7
+ dn 3, 7
dw GengarIntroTiles1
- dn 7, 7
+ dn 7, 7
dw GengarIntroTiles2
- dn 7, 7
+ dn 7, 7
dw GengarIntroTiles3
- dn 7, 7
- dw Unknown_79c20
- dn 8, 6
- dw Unknown_79c50
- dn 3, 12
+ dn 7, 7
+ dw DownscaledMonTiles_79d7c
+ dn 8, 6
+ dw DownscaledMonTiles_79dac
+ dn 3, 12
DownscaledMonTiles_5x5:
- db $31,$38,$46,$54,$5B
- db $32,$39,$47,$55,$5C
- db $34,$3B,$49,$57,$5E
- db $36,$3D,$4B,$59,$60
- db $37,$3E,$4C,$5A,$61
+ db $31, $38, $46, $54, $5B
+ db $32, $39, $47, $55, $5C
+ db $34, $3B, $49, $57, $5E
+ db $36, $3D, $4B, $59, $60
+ db $37, $3E, $4C, $5A, $61
DownscaledMonTiles_3x3:
- db $31,$46,$5B
- db $34,$49,$5E
- db $37,$4C,$61
-
-Unknown_79b24:
- db $00,$07,$0E,$15,$1C,$23,$2A
- db $01,$08,$0F,$16,$1D,$24,$2B
- db $02,$09,$10,$17,$1E,$25,$2C
- db $03,$0A,$11,$18,$1F,$26,$2D
- db $04,$0B,$12,$19,$20,$27,$2E
- db $05,$0C,$13,$1A,$21,$28,$2F
- db $06,$0D,$14,$1B,$22,$29,$30
-
-Unknown_79b55:
- db $00,$07,$0E,$15,$1C,$23,$2A
- db $01,$08,$0F,$16,$1D,$24,$2B
- db $03,$0A,$11,$18,$1F,$26,$2D
- db $04,$0B,$12,$19,$20,$27,$2E
- db $05,$0C,$13,$1A,$21,$28,$2F
-
-Unknown_79b78:
- db $00,$07,$0E,$15,$1C,$23,$2A
- db $02,$09,$10,$17,$1E,$25,$2C
- db $04,$0B,$12,$19,$20,$27,$2E
+ db $31, $46, $5B
+ db $34, $49, $5E
+ db $37, $4C, $61
+
+DownscaledMonTiles_7x7:
+ db $00, $07, $0E, $15, $1C, $23, $2A
+ db $01, $08, $0F, $16, $1D, $24, $2B
+ db $02, $09, $10, $17, $1E, $25, $2C
+ db $03, $0A, $11, $18, $1F, $26, $2D
+ db $04, $0B, $12, $19, $20, $27, $2E
+ db $05, $0C, $13, $1A, $21, $28, $2F
+ db $06, $0D, $14, $1B, $22, $29, $30
+
+DownscaledMonTiles_5x7:
+ db $00, $07, $0E, $15, $1C, $23, $2A
+ db $01, $08, $0F, $16, $1D, $24, $2B
+ db $03, $0A, $11, $18, $1F, $26, $2D
+ db $04, $0B, $12, $19, $20, $27, $2E
+ db $05, $0C, $13, $1A, $21, $28, $2F
+
+DownscaledMonTiles_3x7:
+ db $00, $07, $0E, $15, $1C, $23, $2A
+ db $02, $09, $10, $17, $1E, $25, $2C
+ db $04, $0B, $12, $19, $20, $27, $2E
GengarIntroTiles1:
- db $00,$00,$00,$00,$00,$00,$00
- db $00,$00,$00,$00,$00,$19,$00
- db $02,$06,$0B,$10,$14,$1A,$00
- db $00,$07,$0C,$11,$15,$1B,$00
- db $03,$08,$0D,$12,$16,$1C,$00
- db $04,$09,$0E,$13,$17,$1D,$1F
- db $05,$0A,$0F,$01,$18,$1E,$20
+ db $00, $00, $00, $00, $00, $00, $00
+ db $00, $00, $00, $00, $00, $19, $00
+ db $02, $06, $0B, $10, $14, $1A, $00
+ db $00, $07, $0C, $11, $15, $1B, $00
+ db $03, $08, $0D, $12, $16, $1C, $00
+ db $04, $09, $0E, $13, $17, $1D, $1F
+ db $05, $0A, $0F, $01, $18, $1E, $20
GengarIntroTiles2:
- db $00,$00,$00,$30,$00,$37,$00
- db $00,$00,$2B,$31,$34,$38,$3D
- db $21,$26,$2C,$01,$35,$39,$3E
- db $22,$27,$2D,$32,$36,$01,$00
- db $23,$28,$2E,$33,$01,$3A,$00
- db $24,$29,$2F,$01,$01,$3B,$00
- db $25,$2A,$01,$01,$01,$3C,$00
+ db $00, $00, $00, $30, $00, $37, $00
+ db $00, $00, $2B, $31, $34, $38, $3D
+ db $21, $26, $2C, $01, $35, $39, $3E
+ db $22, $27, $2D, $32, $36, $01, $00
+ db $23, $28, $2E, $33, $01, $3A, $00
+ db $24, $29, $2F, $01, $01, $3B, $00
+ db $25, $2A, $01, $01, $01, $3C, $00
GengarIntroTiles3:
- db $00,$00,$00,$00,$00,$00,$00
- db $00,$00,$47,$4D,$00,$00,$00
- db $00,$00,$48,$4E,$52,$56,$5B
- db $3F,$43,$49,$4F,$53,$57,$5C
- db $40,$44,$4A,$50,$54,$58,$00
- db $41,$45,$4B,$51,$4C,$59,$5D
- db $42,$46,$4C,$4C,$55,$5A,$5E
-
-Unknown_79c20:
- db $31,$32,$32,$32,$32,$33
- db $34,$35,$36,$36,$37,$38
- db $34,$39,$3A,$3A,$3B,$38
- db $3C,$3D,$3E,$3E,$3F,$40
- db $41,$42,$43,$43,$44,$45
- db $46,$47,$43,$48,$49,$4A
- db $41,$43,$4B,$4C,$4D,$4E
- db $4F,$50,$50,$50,$51,$52
-
-Unknown_79c50:
- db $43,$55,$56,$53,$53,$53,$53,$53,$53,$53,$53,$53
- db $43,$57,$58,$54,$54,$54,$54,$54,$54,$54,$54,$54
- db $43,$59,$5A,$43,$43,$43,$43,$43,$43,$43,$43,$43
+ db $00, $00, $00, $00, $00, $00, $00
+ db $00, $00, $47, $4D, $00, $00, $00
+ db $00, $00, $48, $4E, $52, $56, $5B
+ db $3F, $43, $49, $4F, $53, $57, $5C
+ db $40, $44, $4A, $50, $54, $58, $00
+ db $41, $45, $4B, $51, $4C, $59, $5D
+ db $42, $46, $4C, $4C, $55, $5A, $5E
+
+DownscaledMonTiles_79d7c:
+ db $31, $32, $32, $32, $32, $33
+ db $34, $35, $36, $36, $37, $38
+ db $34, $39, $3A, $3A, $3B, $38
+ db $3C, $3D, $3E, $3E, $3F, $40
+ db $41, $42, $43, $43, $44, $45
+ db $46, $47, $43, $48, $49, $4A
+ db $41, $43, $4B, $4C, $4D, $4E
+ db $4F, $50, $50, $50, $51, $52
+
+DownscaledMonTiles_79dac:
+ db $43, $55, $56, $53, $53, $53, $53, $53, $53, $53, $53, $53
+ db $43, $57, $58, $54, $54, $54, $54, $54, $54, $54, $54, $54
+ db $43, $59, $5A, $43, $43, $43, $43, $43, $43, $43, $43, $43
AnimationLeavesFalling:
; Makes leaves float down from the top of the screen. This is used
; in Razor Leaf's animation.
- ld a, [rOBP0]
- push af
ld a, [wAnimPalette]
ld [rOBP0], a
+ call UpdateGBCPal_OBP0
ld d, $37 ; leaf tile
ld a, 3 ; number of leaves
ld [wNumFallingObjects], a
- call AnimationFallingObjects
- pop af
- ld [rOBP0], a
- ret
+ jp AnimationFallingObjects
AnimationPetalsFalling:
; Makes lots of petals fall down from the top of the screen. It's used in
@@ -2747,6 +2915,8 @@ FallingObjects_UpdateOAMEntry:
; movement byte.
ld hl, wOAMBuffer
add hl, de
+ ld a, $1
+ ld [wdef5], a
ld a, [hl]
inc a
inc a
@@ -2755,6 +2925,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
@@ -2771,6 +2947,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
@@ -2780,9 +2963,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
@@ -2822,7 +3015,7 @@ FallingObjects_InitXCoords:
ret
FallingObjects_InitialXCoords:
- db $38,$40,$50,$60,$70,$88,$90,$56,$67,$4A,$77,$84,$98,$32,$22,$5C,$6C,$7D,$8E,$99
+ db $38, $40, $50, $60, $70, $88, $90, $56, $67, $4A, $77, $84, $98, $32, $22, $5C, $6C, $7D, $8E, $99
FallingObjects_InitMovementData:
ld hl, wFallingObjectsMovementData
@@ -2838,7 +3031,7 @@ FallingObjects_InitMovementData:
ret
FallingObjects_InitialMovementData:
- db $00,$84,$06,$81,$02,$88,$01,$83,$05,$89,$09,$80,$07,$87,$03,$82,$04,$85,$08,$86
+ db $00, $84, $06, $81, $02, $88, $01, $83, $05, $89, $09, $80, $07, $87, $03, $82, $04, $85, $08, $86
AnimationShakeEnemyHUD:
; Shakes the enemy HUD.
@@ -2867,6 +3060,14 @@ AnimationShakeEnemyHUD:
ld hl, vBGMap1 - $20 * 7
call BattleAnimCopyTileMapToVRAM
+; update BGMap attributes
+ ld a, [hGBC]
+ and a
+ jr z, .notGBC
+ ld c, 13
+ callba 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
@@ -2900,13 +3101,18 @@ AnimationShakeEnemyHUD:
ld [hWY], a
ld hl, vBGMap1
call BattleAnimCopyTileMapToVRAM
+; update BGMap attributes
+ ld a, [hGBC]
+ and a
+ jr z, .notGBC2
+ ld c, 11
+ callba LoadBGMapAttributes
+.notGBC2
xor a
ld [hWY], a
call SaveScreenTilesToBuffer1
ld hl, vBGMap0
call BattleAnimCopyTileMapToVRAM
- call ClearScreen
- call Delay3
call LoadScreenTilesFromBuffer1
ld hl, vBGMap1
jp BattleAnimCopyTileMapToVRAM
@@ -2995,7 +3201,7 @@ TossBallAnimation:
.PokeBallAnimations:
; sequence of animations that make up the Poké Ball toss
- db POOF_ANIM,HIDEPIC_ANIM,SHAKE_ANIM,POOF_ANIM,SHOWPIC_ANIM
+ db POOF_ANIM, HIDEPIC_ANIM, SHAKE_ANIM, POOF_ANIM, SHOWPIC_ANIM
.BlockBall
ld a, TOSS_ANIM
diff --git a/engine/battle/bank3d_battle.asm b/engine/battle/bank3d_battle.asm
new file mode 100644
index 00000000..0cf24fe1
--- /dev/null
+++ b/engine/battle/bank3d_battle.asm
@@ -0,0 +1,291 @@
+InitBattle:
+ ld a, [wCurOpponent]
+ and a
+ jr z, asm_f6003
+
+InitOpponent:
+ ld a, [wCurOpponent]
+ ld [wcf91], a
+ ld [wEnemyMonSpecies2], a
+ jr asm_f601d
+asm_f6003:
+ ld a, [wd732]
+ bit 1, a
+ jr z, .asm_f600f
+ ld a, [hJoyHeld]
+ bit 1, a ; B button pressed?
+ ret nz
+.asm_f600f
+ ld a, [wNumberOfNoRandomBattleStepsLeft]
+ and a
+ ret nz
+ callab TryDoWildEncounter
+ ret nz
+asm_f601d:
+ 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
+ callab ReadTrainer
+ callab DoBattleTransitionAndInitBattleVariables
+ call _LoadTrainerPic
+ xor a
+ ld [wEnemyMonSpecies2], a
+ ld [$ffe1], a
+ dec a
+ ld [wAICount], a
+ coord hl, 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,InitBattle_Common
+ callabd_ModifyPikachuHappiness PIKAHAPPY_GYMLEADER ; useless since already in bank3d
+ jp InitBattle_Common
+
+InitWildBattle:
+ ld a, $1
+ ld [wIsInBattle], a
+ callab LoadEnemyMonData
+ callab DoBattleTransitionAndInitBattleVariables
+ ld a, [wCurOpponent]
+ cp MAROWAK
+ jr z, .isGhost
+ callab 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
+ ld [$ffe1], a
+ coord hl, 12, 0
+ predef CopyUncompressedPicToTilemap
+
+; common code that executes after init battle code specific to trainer or wild battles
+InitBattle_Common:
+ ld b, $0
+ call RunPaletteCommand
+ callab SlidePlayerAndEnemySilhouettesOnScreen
+ xor a
+ ld [H_AUTOBGTRANSFERENABLED], a
+ ld hl, .emptyString
+ call PrintText
+ call SaveScreenTilesToBuffer1
+ call ClearScreen
+ ld a, $98
+ ld [$ffbd], a
+ ld a, $1
+ ld [H_AUTOBGTRANSFERENABLED], a
+ call Delay3
+ ld a, $9c
+ ld [$ffbd], a
+ call LoadScreenTilesFromBuffer1
+ coord hl, 9, 7
+ ld bc, $50a
+ call ClearScreenArea
+ coord hl, 1, 0
+ ld bc, $40a
+ 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
+ callab StartBattle
+ callab EndOfBattle
+ pop af
+ ld [wLetterPrintingDelayFlags], a
+ pop af
+ ld [wMapPalOffset], a
+ ld a, [wSavedTilesetType]
+ ld [hTilesetType], 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(TrainerPics) ; 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
+ coord hl, 1, 5
+ ld bc,$708
+ 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
+ ld a, [H_LOADEDROMBANK]
+ ld b, a
+ jp CopyVideoData
+
+AnimateSendingOutMon:
+ ld a, [wPredefRegisters]
+ ld h, a
+ ld a, [wPredefRegisters + 1]
+ ld l, a
+ ld a, [$ffe1]
+ ld [H_DOWNARROWBLINKCNT1], a
+ ld b, $4c
+ ld a, [wIsInBattle]
+ and a
+ jr z, .asm_f61ef
+ add b
+ ld [hl], a
+ call Delay3
+ ld bc, -41
+ add hl, bc
+ ld a, $1
+ ld [wNumMovesMinusOne], a
+ ld bc, $303
+ predef CopyDownscaledMonTiles
+ ld c, $4
+ call DelayFrames
+ ld bc, -41
+ add hl, bc
+ xor a
+ ld [wNumMovesMinusOne], a
+ ld bc, $505
+ predef CopyDownscaledMonTiles
+ ld c, $5
+ call DelayFrames
+ ld bc, -41
+ jr .asm_f61f2
+.asm_f61ef
+ ld bc, -123
+.asm_f61f2
+ add hl, bc
+ ld a, [H_DOWNARROWBLINKCNT1]
+ add $31
+ jr CopyUncompressedPicToHL
+
+CopyUncompressedPicToTilemap:
+ ld a, [wPredefRegisters]
+ ld h, a
+ ld a, [wPredefRegisters + 1]
+ ld l, a
+ ld a, [$ffe1]
+CopyUncompressedPicToHL:
+ ld bc, $707
+ ld de, $14
+ push af
+ ld a, [wSpriteFlipped]
+ and a
+ jr nz, .asm_f6220
+ pop af
+.asm_f6211
+ push bc
+ push hl
+.asm_f6213
+ ld [hl], a
+ add hl, de
+ inc a
+ dec c
+ jr nz, .asm_f6213
+ pop hl
+ inc hl
+ pop bc
+ dec b
+ jr nz, .asm_f6211
+ ret
+
+.asm_f6220
+ push bc
+ ld b, $0
+ dec c
+ add hl, bc
+ pop bc
+ pop af
+.asm_f6227
+ push bc
+ push hl
+.asm_f6229
+ ld [hl], a
+ add hl, de
+ inc a
+ dec c
+ jr nz, .asm_f6229
+ pop hl
+ dec hl
+ pop bc
+ dec b
+ jr nz, .asm_f6227
+ ret
+
+INCLUDE "engine/battle/init_battle_variables.asm"
+INCLUDE "engine/battle/moveEffects/focus_energy_effect.asm"
+INCLUDE "engine/battle/moveEffects/heal_effect.asm"
+INCLUDE "engine/battle/moveEffects/transform_effect.asm"
+INCLUDE "engine/battle/moveEffects/reflect_light_screen_effect.asm"
+INCLUDE "engine/battle/moveEffects/mist_effect.asm"
+INCLUDE "engine/battle/moveEffects/one_hit_ko_effect.asm"
+INCLUDE "engine/battle/moveEffects/pay_day_effect.asm"
+INCLUDE "engine/battle/moveEffects/paralyze_effect.asm"
diff --git a/engine/battle/bank_e_misc.asm b/engine/battle/bank_e_misc.asm
index 33af6f6f..df9145f2 100755
--- a/engine/battle/bank_e_misc.asm
+++ b/engine/battle/bank_e_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, wEnemyPartyMons
-.getSpecies
- ld d, 0
- add hl, de
- ld a, [hl]
- ld [wcf91], a
- ret
diff --git a/engine/battle/battle_transitions.asm b/engine/battle/battle_transitions.asm
index 436e38b5..e4392a01 100644
--- a/engine/battle/battle_transitions.asm
+++ b/engine/battle/battle_transitions.asm
@@ -196,6 +196,9 @@ BattleTransition_BlackScreen:
ld [rBGP], a
ld [rOBP0], a
ld [rOBP1], a
+ call UpdateGBCPal_BGP
+ call UpdateGBCPal_OBP0
+ call UpdateGBCPal_OBP1
ret
; for non-dungeon trainer battles
@@ -359,6 +362,7 @@ BattleTransition_FlashScreen_:
cp $1
jr z, .done
ld [rBGP], a
+ call UpdateGBCPal_BGP
ld c, 2
call DelayFrames
jr .loop
@@ -373,7 +377,7 @@ BattleTransition_FlashScreenPalettes:
; used for low level trainer dungeon battles
BattleTransition_Shrink:
- ld c, SCREEN_HEIGHT / 2
+ ld c, 9
.loop
push bc
xor a
@@ -407,7 +411,7 @@ BattleTransition_Shrink:
; used for high level trainer dungeon battles
BattleTransition_Split:
- ld c, SCREEN_HEIGHT / 2
+ ld c, 9
xor a
ld [H_AUTOBGTRANSFERENABLED], a
.loop
diff --git a/engine/battle/common_text.asm b/engine/battle/common_text.asm
index 4a138048..e8f4f002 100644
--- a/engine/battle/common_text.asm
+++ b/engine/battle/common_text.asm
@@ -8,8 +8,20 @@ PrintBeginningBattleText:
cp MR_FUJIS_HOUSE
jr c, .pokemonTower
.notPokemonTower
+ ld a,[wBattleType]
+ cp BATTLE_TYPE_PIKACHU
+ jr nz,.notPikachuBattle
+ callab IsPlayerPikachuAsleepInParty
+ ld e,$24
+ jr c,.asm_f4026
+ ld e,$a
+.asm_f4026
+ callab 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
callab DrawAllPokeballs
pop hl
+.doNotDrawPokeballs
call PrintText
jr .done
.pokemonTower
diff --git a/engine/battle/core.asm b/engine/battle/core.asm
index 2b00a812..60146902 100755
--- a/engine/battle/core.asm
+++ b/engine/battle/core.asm
@@ -157,6 +157,9 @@ SlidePlayerAndEnemySilhouettesOnScreen:
ld [rBGP], a
ld [rOBP0], a
ld [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
@@ -246,10 +249,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?
@@ -983,6 +992,11 @@ ReplaceFaintedEnemyMon:
ld hl, wEnemyHPBarColor
ld e, $30
call GetBattleHealthBarColor
+ setpal SHADE_BLACK, SHADE_DARK, SHADE_LIGHT, SHADE_WHITE
+ ld [rOBP0], a
+ ld [rOBP1], a
+ call UpdateGBCPal_OBP0
+ call UpdateGBCPal_OBP1
callab DrawEnemyPokeballs
ld a, [wLinkState]
cp LINK_STATE_BATTLING
@@ -1048,9 +1062,7 @@ TrainerDefeatedText:
PlayBattleVictoryMusic:
push af
- ld a, $ff
- ld [wNewSoundID], a
- call PlaySoundWaitForCurrent
+ call StopAllMusic
ld c, BANK(Music_DefeatedTrainer)
pop af
call PlayMusic
@@ -1104,6 +1116,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
@@ -1128,10 +1141,36 @@ RemoveFaintedPlayerMon:
and a ; was this called by HandleEnemyMonFainted?
ret z ; if so, return
+ ld a, [wPlayerMonNumber]
+ ld [wWhichPokemon], a
+ callab IsThisPartymonStarterPikachu_Party
+ jr nc, .notPlayerPikachu
+ ld e, $3
+ callab 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:
TX_FAR _PlayerMonFaintedText
@@ -1188,7 +1227,7 @@ ChooseNextMon:
ld a, [wLinkState]
cp LINK_STATE_BATTLING
jr nz, .notLinkBattle
- inc a
+ ld a, 1
ld [wActionResultOrTookBattleTurn], a
call LinkBattleExchangeData
.notLinkBattle
@@ -1588,6 +1627,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
@@ -1843,19 +1884,46 @@ SendOutMon:
call RunPaletteCommand
ld hl, wEnemyBattleStatus1
res USING_TRAPPING_MOVE, [hl]
+ callab IsThisPartymonStarterPikachu
+ jr c, .starterPikachu
ld a, $1
ld [H_WHOSETURN], a
ld a, POOF_ANIM
call PlayMoveAnimation
coord hl, 4, 11
predef AnimateSendingOutMon
+ jr .playRegularCry
+.starterPikachu
+ xor a
+ ld [H_WHOSETURN], a
+ ld a, $1
+ ld [H_AUTOBGTRANSFERENABLED], a
+ callab StarterPikachuBattleEntranceAnimation
+ callab IsPlayerPikachuAsleepInParty
+ ld e, $24
+ jr c, .asm_3cd81
+ ld e, $a
+.asm_3cd81
+ callab 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
+ callab IsThisPartymonStarterPikachu
+ pop bc
+ ld a, b
+ ld [wWhichPokemon], a
+ jr c, .starterPikachu
coord hl, 1, 5
lb bc, 7, 7
call ClearScreenArea
@@ -1879,10 +1947,17 @@ AnimateRetreatingPlayerMon:
call .clearScreenArea
ld a, $4c
Coorda 5, 11
+ jr .clearScreenArea
+.starterPikachu
+ xor a
+ ld [H_WHOSETURN], a
+ callab AnimationSlideMonOff
+ ret
.clearScreenArea
coord hl, 1, 5
lb bc, 7, 7
- jp ClearScreenArea
+ call ClearScreenArea
+ ret
; reads player's current mon's HP into wBattleMonHP
ReadPlayerMonCurHPAndStatus:
@@ -2104,36 +2179,49 @@ DisplayBattleMenu:
ld [wTextBoxID], a
call DisplayTextBoxID
ld a, [wBattleType]
- dec a
- jp nz, .handleBattleMenuInput ; handle menu input if it's not the old man tutorial
-; the following happens for the old man tutorial
+ cp BATTLE_TYPE_OLD_MAN
+ jr z, .doSimulatedMenuInput ; simulate menu input if it's the old man or prof. oak pikachu battle
+ cp BATTLE_TYPE_PIKACHU
+ jr z, .doSimulatedMenuInput
+ jp .handleBattleMenuInput
+; the following happens for the old man tutorial and prof. oak pikachu battle
+.doSimulatedMenuInput
ld hl, wPlayerName
ld de, wGrassRate
ld bc, NAME_LENGTH
call CopyData ; temporarily save the player name in unused space,
; which is supposed to get overwritten when entering a
- ; map with wild Pokémon. Due to an oversight, the data
+ ; map with wild Pokémon.
+ ; In Red/Blue, due to an oversight, the data
; may not get overwritten (cinnabar) and the infamous
- ; Missingno. glitch can show up.
+ ; Missingno. glitch can show up. However,
+ ; this has been fixed in yellow
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
coord hl, 9, 14
ld [hl], "▶"
- ld c, 80
+ ld c, 20
call DelayFrames
ld [hl], " "
coord hl, 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
@@ -2216,6 +2304,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
@@ -2247,7 +2338,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
+ TX_FAR _RunAwayText
+ db "@"
.upperLeftMenuItemWasNotSelected ; a menu item other than the upper left item was selected
cp $2
@@ -2284,19 +2386,23 @@ 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:
- db 1 ; # items
- db POKE_BALL, 50
- db -1
+SimulatedInputBattleItemList:
+ db 1 ; # of items
+ db POKE_BALL, 1
+ db $ff
DisplayPlayerBag:
; get the pointer to player's bag when in a normal battle
@@ -2455,6 +2561,8 @@ PartyMenuOrRockOrRun:
predef StatusScreen
predef StatusScreen2
; now we need to reload the enemy mon pic
+ ld a, 1
+ ld [H_WHOSETURN], a
ld a, [wEnemyBattleStatus2]
bit HAS_SUBSTITUTE_UP, a ; does the enemy mon have a substitute?
ld hl, AnimationSubstitute
@@ -2559,13 +2667,13 @@ MoveSelectionMenu:
.writemoves
ld de, wMovesString
- ld a, [hFlags_0xFFF6]
+ ld a, [hFlags_0xFFFA]
set 2, a
- ld [hFlags_0xFFF6], a
+ ld [hFlags_0xFFFA], a
call PlaceString
- ld a, [hFlags_0xFFF6]
+ ld a, [hFlags_0xFFFA]
res 2, a
- ld [hFlags_0xFFF6], a
+ ld [hFlags_0xFFFA], a
ret
.regularmenu
@@ -2574,9 +2682,8 @@ MoveSelectionMenu:
ld hl, wBattleMonMoves
call .loadmoves
coord hl, 4, 12
- ld b, 4
- ld c, 14
- di ; out of pure coincidence, it is possible for vblank to occur between the di and ei
+ 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
coord hl, 4, 12
@@ -2593,8 +2700,7 @@ MoveSelectionMenu:
ld hl, wEnemyMonMoves
call .loadmoves
coord hl, 0, 7
- ld b, 4
- ld c, 14
+ lb bc, 4, 14
call TextBoxBorder
coord hl, 2, 8
call .writemoves
@@ -2608,8 +2714,7 @@ MoveSelectionMenu:
call AddNTimes
call .loadmoves
coord hl, 4, 7
- ld b, 4
- ld c, 14
+ lb bc, 4, 14
call TextBoxBorder
coord hl, 6, 8
call .writemoves
@@ -2623,8 +2728,6 @@ MoveSelectionMenu:
ld a, [wMoveMenuType]
cp $1
jr z, .selectedmoveknown
- ld a, $1
- jr nc, .selectedmoveknown
ld a, [wPlayerMoveListIndex]
inc a
.selectedmoveknown
@@ -2685,10 +2788,10 @@ SelectMenuItem:
call AddNTimes
ld [hl], "▷"
.select
- ld hl, hFlags_0xFFF6
+ ld hl, hFlags_0xFFFA
set 1, [hl]
call HandleMenuInput
- ld hl, hFlags_0xFFF6
+ ld hl, hFlags_0xFFFA
res 1, [hl]
bit 6, a
jp nz, SelectMenuItem_CursorUp ; up
@@ -2790,6 +2893,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
+ ld [H_WHOSETURN], a
+ call LoadScreenTilesFromBuffer1
+ call Func_3d536
+ ld a, [wTestBattlePlayerSelectedMove]
+ and a
+ jp z, MoveSelectionMenu
+ ld [wAnimationID], a
+ xor a
+ ld [wAnimationType], a
+ predef MoveAnimation
+ callab 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:
+ coord hl, 10, 16
+ lb bc, 2, 10
+ call ClearScreenArea
+ coord hl, 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
+ coord hl, 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
@@ -2823,7 +2975,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
@@ -2838,6 +2993,9 @@ NoMovesLeftText:
db "@"
SwapMovesInMenu:
+ ld a, [wPlayerBattleStatus3]
+ bit TRANSFORMED, a
+ jp nz, MoveSelectionMenu
ld a, [wMenuItemToSwap]
and a
jr z, .noMenuItemSelected
@@ -2917,8 +3075,7 @@ PrintMenuItem:
xor a
ld [H_AUTOBGTRANSFERENABLED], a
coord hl, 0, 8
- ld b, 3
- ld c, 9
+ lb bc, 3, 9
call TextBoxBorder
ld a, [wPlayerDisabledMove]
and a
@@ -2985,7 +3142,7 @@ PrintMenuItem:
jp Delay3
DisabledText:
- db "disabled!@"
+ db "Disabled!@"
TypeText:
db "TYPE@"
@@ -3905,11 +4062,13 @@ DetermineExclamationPointTextNum:
ret
ExclamationPointMoveSets:
+; a grammar mistake was fixed (only concerning japanese)
+; BIDE is in category 3, moved from category 2
db SWORDS_DANCE, GROWTH
db $00
- db RECOVER, BIDE, SELFDESTRUCT, AMNESIA
+ db RECOVER, SELFDESTRUCT, AMNESIA
db $00
- db MEDITATE, AGILITY, TELEPORT, MIMIC, DOUBLE_TEAM, BARRAGE
+ db MEDITATE, AGILITY, TELEPORT, MIMIC, DOUBLE_TEAM, BIDE, BARRAGE
db $00
db POUND, SCRATCH, VICEGRIP, WING_ATTACK, FLY, BIND, SLAM, HORN_ATTACK, BODY_SLAM
db WRAP, THRASH, TAIL_WHIP, LEER, BITE, GROWL, ROAR, SING, PECK, COUNTER
@@ -4593,31 +4752,31 @@ CalculateDamage:
ld a, [H_QUOTIENT + 3]
add b
ld [H_QUOTIENT + 3], a
- jr nc, .asm_3dfd0
+ jr nc, .asm_3e142
ld a, [H_QUOTIENT + 2]
inc a
ld [H_QUOTIENT + 2], a
and a
- jr z, .asm_3e004
+ jr z, .asm_3e176
-.asm_3dfd0
+.asm_3e142
ld a, [H_QUOTIENT]
ld b, a
ld a, [H_QUOTIENT + 1]
or a
- jr nz, .asm_3e004
+ jr nz, .asm_3e176
ld a, [H_QUOTIENT + 2]
cp 998 / $100
- jr c, .asm_3dfe8
+ jr c, .asm_3e15a
cp 998 / $100 + 1
- jr nc, .asm_3e004
+ jr nc, .asm_3e176
ld a, [H_QUOTIENT + 3]
cp 998 % $100
- jr nc, .asm_3e004
+ jr nc, .asm_3e176
-.asm_3dfe8
+.asm_3e15a
inc hl
ld a, [H_QUOTIENT + 3]
ld b, [hl]
@@ -4628,26 +4787,26 @@ CalculateDamage:
ld b, [hl]
adc b
ld [hl], a
- jr c, .asm_3e004
+ jr c, .asm_3e176
ld a, [hl]
cp 998 / $100
- jr c, .asm_3e00a
+ jr c, .asm_3e17c
cp 998 / $100 + 1
- jr nc, .asm_3e004
+ jr nc, .asm_3e176
inc hl
ld a, [hld]
cp 998 % $100
- jr c, .asm_3e00a
+ jr c, .asm_3e17c
-.asm_3e004
+.asm_3e176
; cap at 997
ld a, 997 / $100
ld [hli], a
ld a, 997 % $100
ld [hld], a
-.asm_3e00a
+.asm_3e17c
; add 2
inc hl
ld a, [hl]
@@ -4677,7 +4836,7 @@ UnusedHighCriticalMoves:
db $FF
; determines if attack is a critical hit
-; azure heights claims "the fastest pokémon (who are,not coincidentally,
+; azure heights claims "the fastest pokémon (who are, not coincidentally,
; among the most popular) tend to CH about 20 to 25% of the time."
CriticalHitTest:
xor a
@@ -5098,7 +5257,7 @@ AttackSubstitute:
ld a, [H_WHOSETURN]
xor $01
ld [H_WHOSETURN], a
- callab HideSubstituteShowMonAnim ; animate the substitute breaking
+ callab Func_79929 ; animate the substitute breaking
; flip the turn back to the way it was
ld a, [H_WHOSETURN]
xor $01
@@ -5395,32 +5554,26 @@ AdjustDamageForMoveType:
.done
ret
-; function to tell how effective the type of an enemy attack is on the player's current pokemon
-; this doesn't take into account the effects that dual types can have
-; (e.g. 4x weakness / resistance, weaknesses and resistances canceling)
-; the result is stored in [wTypeEffectiveness]
-; ($05 is not very effective, $10 is neutral, $14 is super effective)
-; as far is can tell, this is only used once in some AI code to help decide which move to use
AIGetTypeEffectiveness:
ld a, [wEnemyMoveType]
- ld d, a ; d = type of enemy move
+ ld d, a ; d = type of enemy move
ld hl, wBattleMonType
- ld b, [hl] ; b = type 1 of player's pokemon
+ ld b, [hl] ; b = type 1 of player's pokemon
inc hl
- ld c, [hl] ; c = type 2 of player's pokemon
+ ld c, [hl] ; c = type 2 of player's pokemon
ld a, $10
- ld [wTypeEffectiveness], a ; initialize to neutral effectiveness
+ ld [wd11e], a ; initialize [wd11e] to neutral effectiveness
ld hl, TypeEffects
.loop
ld a, [hli]
cp $ff
ret z
- cp d ; match the type of the move
+ cp d ; match the type of the move
jr nz, .nextTypePair1
ld a, [hli]
- cp b ; match with type 1 of pokemon
+ cp b ; match with type 1 of pokemon
jr z, .done
- cp c ; or match with type 2 of pokemon
+ cp c ; or match with type 2 of pokemon
jr z, .done
jr .nextTypePair2
.nextTypePair1
@@ -5428,9 +5581,21 @@ AIGetTypeEffectiveness:
.nextTypePair2
inc hl
jr .loop
+
.done
+ 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
+ ld [wd11e], a ; store damage multiplier
ret
INCLUDE "data/type_effects.asm"
@@ -6409,10 +6574,13 @@ 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, OldManPic
+ 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)
call UncompressSpriteFromDE
@@ -6437,6 +6605,8 @@ LoadPlayerBackPic:
ld [hli], a ; OAM tile number
inc a ; increment tile number
ld [hOAMTile], a
+ ld a, $2
+ ld [hl], a
inc hl
dec c
jr nz, .innerLoop
@@ -6450,18 +6620,15 @@ LoadPlayerBackPic:
jr nz, .loop
ld de, vBackPic
call InterlaceMergeSpriteBuffers
- ld a, $a
- ld [$0], a
- xor a
- ld [$4000], a
+ ld a, $0
+ call SwitchSRAMBankAndLatchClockData
ld hl, vSprites
ld de, sSpriteBuffer1
ld a, [H_LOADEDROMBANK]
ld b, a
ld c, 7 * 7
call CopyVideoData
- xor a
- ld [$0], a
+ call PrepareRTCDataAndDisableSRAM
ld a, $31
ld [hStartTileID], a
coord hl, 1, 5
@@ -6832,292 +6999,10 @@ 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
- ld a, [hJoyHeld]
- bit 1, a ; B button pressed?
- ret nz
-.asm_3ef2f
- ld a, [wNumberOfNoRandomBattleStepsLeft]
- and a
- ret nz
- callab TryDoWildEncounter
- ret nz
-InitBattleCommon:
- ld a, [wMapPalOffset]
- push af
- ld hl, wLetterPrintingDelayFlags
- ld a, [hl]
- push af
- res 1, [hl]
- callab InitBattleVariables
- ld a, [wEnemyMonSpecies2]
- sub OPP_ID_OFFSET
- jp c, InitWildBattle
- ld [wTrainerClass], a
- call GetTrainerInformation
- callab ReadTrainer
- call DoBattleTransitionAndInitBattleVariables
- call _LoadTrainerPic
- xor a
- ld [wEnemyMonSpecies2], a
- ld [hStartTileID], a
- dec a
- ld [wAICount], a
- coord hl, 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 MAROWAK
- 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
- ld [hStartTileID], a
- coord hl, 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
- ld [H_AUTOBGTRANSFERENABLED], a
- ld hl, .emptyString
- call PrintText
- call SaveScreenTilesToBuffer1
- call ClearScreen
- ld a, $98
- ld [H_AUTOBGTRANSFERDEST + 1], a
- ld a, $1
- ld [H_AUTOBGTRANSFERENABLED], a
- call Delay3
- ld a, $9c
- ld [H_AUTOBGTRANSFERDEST + 1], a
- call LoadScreenTilesFromBuffer1
- coord hl, 9, 7
- lb bc, 5, 10
- call ClearScreenArea
- coord hl, 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
- callab EndOfBattle
- pop af
- ld [wLetterPrintingDelayFlags], a
- pop af
- ld [wMapPalOffset], a
- ld a, [wSavedTilesetType]
- ld [hTilesetType], 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(TrainerPics) ; 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, [wPredefRegisters]
- ld h, a
- ld a, [wPredefRegisters + 1]
- ld l, a
- ld a, [hStartTileID]
- ld [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
- ld a, [hBaseTileID]
- add $31
- jr CopyUncompressedPicToHL
-
-CopyUncompressedPicToTilemap:
- ld a, [wPredefRegisters]
- ld h, a
- ld a, [wPredefRegisters + 1]
- ld l, a
- ld 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
+ callab Func_78e98
ret
-LoadMonBackPic:
-; Assumes the monster's attributes have
-; been loaded with GetMonHeader.
- ld a, [wBattleMonSpecies2]
- ld [wcf91], a
- coord hl, 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
- ld a, [H_LOADEDROMBANK]
- ld b, a
- jp CopyVideoData
-
JumpMoveEffect:
call _JumpMoveEffect
ld b, $1
@@ -7266,6 +7151,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
@@ -7404,7 +7299,7 @@ FreezeBurnParalyzeEffect:
ret nz ; return if they have a substitute, can't effect them
ld a, [H_WHOSETURN]
and a
- jp nz, opponentAttacker
+ jp nz, .opponentAttacker
ld a, [wEnemyMonStatus]
and a
jp nz, CheckDefrost ; can't inflict status if opponent is already statused
@@ -7417,7 +7312,17 @@ FreezeBurnParalyzeEffect:
cp b ; do target type 2 and move type match?
ret z ; return if they match
ld a, [wPlayerMoveEffect]
- cp PARALYZE_SIDE_EFFECT1 + 1 ; 10% status effects are 04, 05, 06 so 07 will set carry for those
+ cp UNUSED_EFFECT_23 ; more stadium stuff
+ jr nz, .asm_3f2c7
+ ld a, [wUnknownSerialFlag_d499]
+ and a
+ ld a, FREEZE_SIDE_EFFECT
+ ld b, $4d ; else use 0x4D/0x100 or 77/256 = 30.1%~ chance
+ jr z, .next1
+ ld b, $1a ; 0x1A/0x100 or 26/256 = 10.2%~ chance
+ jr .next1
+.asm_3f2c7
+ cp a, PARALYZE_SIDE_EFFECT1 + 1 ; 10% status effects are 04, 05, 06 so 07 will set carry for those
ld b, $1a ; 0x1A/0x100 or 26/256 = 10.2%~ chance
jr c, .next1 ; branch ahead if this is a 10% chance effect..
ld b, $4d ; else use 0x4D/0x100 or 77/256 = 30.1%~ chance
@@ -7430,9 +7335,9 @@ FreezeBurnParalyzeEffect:
ret nc ; do nothing if random value is >= 1A or 4D [no status applied]
ld a, b ; what type of effect is this?
cp BURN_SIDE_EFFECT1
- jr z, .burn
+ jr z, .burn1
cp FREEZE_SIDE_EFFECT
- jr z, .freeze
+ jr z, .freeze1
; .paralyze
ld a, 1 << PAR
ld [wEnemyMonStatus], a
@@ -7440,7 +7345,7 @@ FreezeBurnParalyzeEffect:
ld a, ANIM_A9
call PlayBattleAnimation
jp PrintMayNotAttackText ; print paralysis text
-.burn
+.burn1
ld a, 1 << BRN
ld [wEnemyMonStatus], a
call HalveAttackDueToBurn ; halve attack of affected mon
@@ -7448,7 +7353,7 @@ FreezeBurnParalyzeEffect:
call PlayBattleAnimation
ld hl, BurnedText
jp PrintText
-.freeze
+.freeze1
call ClearHyperBeam ; resets hyper beam (recharge) condition from target
ld a, 1 << FRZ
ld [wEnemyMonStatus], a
@@ -7456,7 +7361,7 @@ FreezeBurnParalyzeEffect:
call PlayBattleAnimation
ld hl, FrozenText
jp PrintText
-opponentAttacker:
+.opponentAttacker
ld a, [wBattleMonStatus] ; mostly same as above with addresses swapped for opponent
and a
jp nz, CheckDefrost
@@ -7469,12 +7374,22 @@ opponentAttacker:
cp b
ret z
ld a, [wEnemyMoveEffect]
- cp PARALYZE_SIDE_EFFECT1 + 1
+ cp UNUSED_EFFECT_23 ; more stadium stuff
+ jr nz, .asm_3f341
+ ld a, [wUnknownSerialFlag_d499]
+ and a
+ ld a, FREEZE_SIDE_EFFECT
+ ld b, $4d ; else use 0x4D/0x100 or 77/256 = 30.1%~ chance
+ jr z, .next2
+ ld b, $1a ; 0x1A/0x100 or 26/256 = 10.2%~ chance
+ jr .next2
+.asm_3f341
+ cp a, PARALYZE_SIDE_EFFECT1 + 1
ld b, $1a
- jr c, .next1
+ jr c, .next2
ld b, $4d
sub $1e
-.next1
+.next2
push af
call BattleRandom
cp b
@@ -7482,23 +7397,29 @@ opponentAttacker:
ret nc
ld a, b
cp BURN_SIDE_EFFECT1
- jr z, .burn
+ jr z, .burn2
cp FREEZE_SIDE_EFFECT
- jr z, .freeze
+ jr z, .freeze2
ld a, 1 << PAR
ld [wBattleMonStatus], a
call QuarterSpeedDueToParalysis
+ ld a, ANIM_C7
+ call PlayBattleAnimation2
jp PrintMayNotAttackText
-.burn
+.burn2
ld a, 1 << BRN
ld [wBattleMonStatus], a
call HalveAttackDueToBurn
+ ld a, ANIM_C7
+ call PlayBattleAnimation2
ld hl, BurnedText
jp PrintText
-.freeze
+.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
@@ -7663,25 +7584,25 @@ UpdateStatDone:
ld bc, wPlayerMonMinimized
ld a, [H_WHOSETURN]
and a
- jr z, .asm_3f4e6
+ jr z, .playerTurn
ld hl, wEnemyBattleStatus2
ld de, wEnemyMoveNum
ld bc, wEnemyMonMinimized
-.asm_3f4e6
+.playerTurn
ld a, [de]
cp MINIMIZE
- jr nz, .asm_3f4f9
+ jr nz, .notMinimize
; if a substitute is up, slide off the substitute and show the mon pic before
; playing the minimize animation
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
-.asm_3f4f9
+.notMinimize
call PlayCurrentMoveAnimation
ld a, [de]
cp MINIMIZE
@@ -8199,6 +8120,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
@@ -8240,10 +8164,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
@@ -8713,6 +8654,7 @@ PlayBattleAnimationGotID:
push de
push bc
predef MoveAnimation
+ callab Func_78e98
pop bc
pop de
pop hl
diff --git a/engine/battle/draw_hud_pokeball_gfx.asm b/engine/battle/draw_hud_pokeball_gfx.asm
index 323dd167..96294774 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/end_of_battle.asm b/engine/battle/end_of_battle.asm
index 830a23a1..5c0c3991 100755
--- 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
callab DisplayLinkBattleVersusTextBox
ld a, [wBattleResult]
cp $1
@@ -43,6 +45,8 @@ EndOfBattle:
xor a
ld [wForceEvolution], a
predef EvolutionAfterBattle
+ ld d, $82
+ callab UpdatePikachuMoodAfterBattle
.resetVariables
xor a
ld [wLowHealthAlarm], a ;disable low health alarm
diff --git a/engine/battle/experience.asm b/engine/battle/experience.asm
index 24748338..722685c2 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 ; 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
- callab CalculateModifiedStats
- callab ApplyBurnAndParalysisPenaltiesToPlayer
- callab ApplyBadgeStatBoosts
- callab DrawPlayerHUDAndHPBar
- callab PrintEmptyString
+ ld hl, CalculateModifiedStats
+ call Bankswitch15ToF
+ ld hl, ApplyBurnAndParalysisPenaltiesToPlayer
+ call Bankswitch15ToF
+ ld hl, ApplyBadgeStatBoosts
+ call Bankswitch15ToF
+ ld hl, DrawPlayerHUDAndHPBar
+ call Bankswitch15ToF
+ ld hl, PrintEmptyString
+ call Bankswitch15ToF
call SaveScreenTilesToBuffer1
.printGrewLevelText
+ callabd_ModifyPikachuHappiness PIKAHAPPY_LEVELUP
ld hl, GrewLevelText
call PrintText
xor a ; PLAYER_PARTY_DATA
@@ -339,6 +345,10 @@ BoostExp:
ld [H_QUOTIENT + 2], a
ret
+Bankswitch15ToF:
+ ld b, BANK(BattleCore)
+ jp Bankswitch
+
GainedText:
TX_FAR _GainedText
TX_ASM
diff --git a/engine/battle/ghost_marowak_anim.asm b/engine/battle/ghost_marowak_anim.asm
index 7adb20d8..5bb3e308 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
ld [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
coord hl, 12, 0
@@ -27,6 +28,7 @@ MarowakAnim:
sla a
sla a
ld [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
ld [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, $10 ; use OBP1
+ ld a, $14 ; use OBP1
ld [hli], a
inc d
dec c
diff --git a/engine/battle/link_battle_versus_text.asm b/engine/battle/link_battle_versus_text.asm
index 76559117..63142ba6 100644
--- a/engine/battle/link_battle_versus_text.asm
+++ b/engine/battle/link_battle_versus_text.asm
@@ -2,8 +2,7 @@
DisplayLinkBattleVersusTextBox:
call LoadTextBoxTilePatterns
coord hl, 3, 4
- ld b, 7
- ld c, 12
+ lb bc, 7, 12
call TextBoxBorder
coord hl, 4, 5
ld de, wPlayerName
diff --git a/engine/battle/moveEffects/heal_effect.asm b/engine/battle/moveEffects/heal_effect.asm
index 2e68acc0..97afa394 100644
--- a/engine/battle/moveEffects/heal_effect.asm
+++ b/engine/battle/moveEffects/heal_effect.asm
@@ -86,7 +86,7 @@ HealEffect_:
ld [wHPBarNewHP], a
.playAnim
ld hl, PlayCurrentMoveAnimation
- call BankswitchEtoF
+ call Bankswitch3DtoF
ld a, [H_WHOSETURN]
and a
coord hl, 10, 9
@@ -98,14 +98,14 @@ HealEffect_:
ld [wHPBarType], a
predef UpdateHPBar2
ld hl, DrawHUDsAndHPBars
- call BankswitchEtoF
+ call Bankswitch3DtoF
ld hl, RegainedHealthText
jp PrintText
.failed
ld c, 50
call DelayFrames
ld hl, PrintButItFailedText_
- jp BankswitchEtoF
+ jp Bankswitch3DtoF
StartedSleepingEffect:
TX_FAR _StartedSleepingEffect
diff --git a/engine/battle/moveEffects/reflect_light_screen_effect.asm b/engine/battle/moveEffects/reflect_light_screen_effect.asm
index 2805a969..e5748b19 100644
--- a/engine/battle/moveEffects/reflect_light_screen_effect.asm
+++ b/engine/battle/moveEffects/reflect_light_screen_effect.asm
@@ -23,14 +23,14 @@ ReflectLightScreenEffect_:
.playAnim
push hl
ld hl, PlayCurrentMoveAnimation
- call BankswitchEtoF
+ call Bankswitch3DtoF
pop hl
jp PrintText
.moveFailed
ld c, 50
call DelayFrames
ld hl, PrintButItFailedText_
- jp BankswitchEtoF
+ jp Bankswitch3DtoF
LightScreenProtectedText:
TX_FAR _LightScreenProtectedText
@@ -40,6 +40,6 @@ ReflectGainedArmorText:
TX_FAR _ReflectGainedArmorText
db "@"
-BankswitchEtoF:
+Bankswitch3DtoF:
ld b, BANK(BattleCore)
jp Bankswitch
diff --git a/engine/battle/moveEffects/transform_effect.asm b/engine/battle/moveEffects/transform_effect.asm
index 9a5de9cc..ec07b303 100644
--- a/engine/battle/moveEffects/transform_effect.asm
+++ b/engine/battle/moveEffects/transform_effect.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
@@ -141,7 +134,7 @@ TransformEffect_:
.failed
ld hl, PrintButItFailedText_
- jp BankswitchEtoF
+ jp Bankswitch3DtoF
TransformedText:
TX_FAR _TransformedText
diff --git a/engine/battle/read_trainer_party.asm b/engine/battle/read_trainer_party.asm
index ba4f6f8e..b4ee46a0 100755
--- 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 $C9 ; 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
- and a
- jr z, .AddTeamMove
- dec a
- add a
+.AddAdditionalMoveData
+; does the trainer have additional move data?
+ ld a, [wTrainerClass]
+ ld b, a
+ ld a, [wTrainerNo]
ld c, a
- ld b, 0
- ld hl, LoneMoves
- add hl, bc
+ ld hl, SpecialTrainerMoves
+.loopAdditionalMoveData
+ ld a, [hli]
+ cp $ff
+ jr z, .FinishUp
+ cp b
+ jr nz, .asm_39c46
ld a, [hli]
- ld d, [hl]
- ld hl, wEnemyMon1Moves + 2
+ cp c
+ jr nz, .asm_39c46
+ ld d, h
+ ld e, l
+.writeAdditionalMoveDataLoop
+ ld a, [de]
+ inc de
+ and a
+ jp z, .FinishUp
+ dec a
+ ld hl, wEnemyMon1Moves
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, [de]
+ inc de
+ dec a
+ ld c, a
+ ld b, 0
+ add hl,bc
+ ld a, [de]
+ inc de
+ ld [hl], a
+ jr .writeAdditionalMoveDataLoop
+.asm_39c46
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 SONY3
- 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/safari_zone.asm b/engine/battle/safari_zone.asm
index 4672892d..88064f9a 100755
--- a/engine/battle/safari_zone.asm
+++ b/engine/battle/safari_zone.asm
@@ -2,18 +2,18 @@ PrintSafariZoneBattleText:
ld hl, wSafariBaitFactor
ld a, [hl]
and a
- jr z, .asm_4284
+ jr z, .asm_411e
dec [hl]
ld hl, SafariZoneEatingText
- jr .asm_429f
-.asm_4284
+ jr .asm_4138
+.asm_411e
dec hl
ld a, [hl]
and a
ret z
dec [hl]
ld hl, SafariZoneAngryText
- jr nz, .asm_429f
+ jr nz, .asm_4138
push hl
ld a, [wEnemyMonSpecies]
ld [wd0b5], a
@@ -21,7 +21,7 @@ PrintSafariZoneBattleText:
ld a, [wMonHCatchRate]
ld [wEnemyMonActualCatchRate], a
pop hl
-.asm_429f
+.asm_4138
push hl
call LoadScreenTilesFromBuffer1
pop hl
diff --git a/engine/battle/scale_sprites.asm b/engine/battle/scale_sprites.asm
index 98521528..c614d638 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 ac6c1a72..c8fdfb29 100644
--- a/engine/battle/trainer_ai.asm
+++ b/engine/battle/trainer_ai.asm
@@ -295,7 +295,7 @@ TrainerClassMoveChoiceModifications:
db 1,0 ; GAMBLER
db 1,3,0 ; BEAUTY
db 1,2,0 ; PSYCHIC_TR
- db 1,3,0 ; ROCKER
+ db 1,0 ; ROCKER
db 1,0 ; JUGGLER
db 1,0 ; TAMER
db 1,0 ; BIRD_KEEPER
@@ -311,11 +311,11 @@ TrainerClassMoveChoiceModifications:
db 1,0 ; BRUNO
db 1,0 ; BROCK
db 1,3,0 ; MISTY
- db 1,3,0 ; LT_SURGE
+ db 1,0 ; LT_SURGE
db 1,3,0 ; ERIKA
db 1,3,0 ; KOGA
- db 1,3,0 ; BLAINE
- db 1,3,0 ; SABRINA
+ db 1,0 ; BLAINE
+ db 1,0 ; SABRINA
db 1,2,0 ; GENTLEMAN
db 1,3,0 ; SONY2
db 1,3,0 ; SONY3
@@ -337,14 +337,20 @@ INCLUDE "data/trainer_moves.asm"
INCLUDE "data/trainer_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
- ld a, [wTrainerClass] ; what trainer class is this?
+ 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 ; %10011
+ jr nz, .done ; don't follow trainer ai if opponent is in a locked state
+ ld a, [wEnemyBattleStatus2]
+ and 1 << USING_RAGE ; %1000000
+ 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
ld b, 0
@@ -354,7 +360,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
@@ -367,6 +373,9 @@ TrainerAI:
ld l, a
call Random
jp hl
+.done
+ and a
+ ret
TrainerAIPointers:
; one entry per trainer class
@@ -476,22 +485,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
Sony2AI:
cp 13 percent - 1
diff --git a/engine/battle/wild_encounters.asm b/engine/battle/wild_encounters.asm
index 231c46e7..0285346e 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?
- coord hl, 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
+ coord hl, 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/bcd.asm b/engine/bcd.asm
index 2d0b43df..d84e504b 100644
--- a/engine/bcd.asm
+++ b/engine/bcd.asm
@@ -1,14 +1,17 @@
+; divide hMoney by hDivideBCDDivisor
+; return output in hDivideBCDQuotient (same as hDivideBCDDivisor)
+; used only to halve player money upon losing a fight
DivideBCDPredef::
DivideBCDPredef2::
-DivideBCDPredef3::
+DivideBCDPredef3:: ; only used function
DivideBCDPredef4::
call GetPredefRegisters
DivideBCD::
xor a
ld [hDivideBCDBuffer], a
- ld [hDivideBCDBuffer+1], a
- ld [hDivideBCDBuffer+2], a
+ ld [hDivideBCDBuffer + 1], a
+ ld [hDivideBCDBuffer + 2], a
ld d, $1
.mulBy10Loop
; multiply the divisor by 10 until the leading digit is nonzero
@@ -21,25 +24,26 @@ DivideBCD::
swap a
and $f0
ld b, a
- ld a, [hDivideBCDDivisor+1]
+ ld a, [hDivideBCDDivisor + 1]
swap a
- ld [hDivideBCDDivisor+1], a
+ ld [hDivideBCDDivisor + 1], a
and $f
or b
ld [hDivideBCDDivisor], a
- ld a, [hDivideBCDDivisor+1]
+ ld a, [hDivideBCDDivisor + 1]
and $f0
ld b, a
- ld a, [hDivideBCDDivisor+2]
+ ld a, [hDivideBCDDivisor + 2]
swap a
- ld [hDivideBCDDivisor+2], a
+ ld [hDivideBCDDivisor + 2], a
and $f
or b
- ld [hDivideBCDDivisor+1], a
- ld a, [hDivideBCDDivisor+2]
+ ld [hDivideBCDDivisor + 1], a
+ ld a, [hDivideBCDDivisor + 2]
and $f0
- ld [hDivideBCDDivisor+2], a
+ ld [hDivideBCDDivisor + 2], a
jr .mulBy10Loop
+
.next
push de
push de
@@ -67,16 +71,16 @@ DivideBCD::
ld a, b
swap a
and $f0
- ld [hDivideBCDBuffer+1], a
+ ld [hDivideBCDBuffer + 1], a
dec d
jr z, .next2
push de
call DivideBCD_divDivisorBy10
call DivideBCD_getNextDigit
pop de
- ld a, [hDivideBCDBuffer+1]
+ ld a, [hDivideBCDBuffer + 1]
or b
- ld [hDivideBCDBuffer+1], a
+ ld [hDivideBCDBuffer + 1], a
dec d
jr z, .next2
push de
@@ -86,23 +90,23 @@ DivideBCD::
ld a, b
swap a
and $f0
- ld [hDivideBCDBuffer+2], a
+ ld [hDivideBCDBuffer + 2], a
dec d
jr z, .next2
push de
call DivideBCD_divDivisorBy10
call DivideBCD_getNextDigit
pop de
- ld a, [hDivideBCDBuffer+2]
+ ld a, [hDivideBCDBuffer + 2]
or b
- ld [hDivideBCDBuffer+2], a
+ ld [hDivideBCDBuffer + 2], a
.next2
ld a, [hDivideBCDBuffer]
ld [hDivideBCDQuotient], a ; the same memory location as hDivideBCDDivisor
- ld a, [hDivideBCDBuffer+1]
- ld [hDivideBCDQuotient+1], a
- ld a, [hDivideBCDBuffer+2]
- ld [hDivideBCDQuotient+2], a
+ ld a, [hDivideBCDBuffer + 1]
+ ld [hDivideBCDQuotient + 1], a
+ ld a, [hDivideBCDBuffer + 2]
+ ld [hDivideBCDQuotient + 2], a
pop de
ld a, $6
sub d
@@ -117,17 +121,17 @@ DivideBCD::
ret
DivideBCD_divDivisorBy10:
- ld a, [hDivideBCDDivisor+2]
+ ld a, [hDivideBCDDivisor + 2]
swap a
and $f
ld b, a
- ld a, [hDivideBCDDivisor+1]
+ ld a, [hDivideBCDDivisor + 1]
swap a
- ld [hDivideBCDDivisor+1], a
+ ld [hDivideBCDDivisor + 1], a
and $f0
or b
- ld [hDivideBCDDivisor+2], a
- ld a, [hDivideBCDDivisor+1]
+ ld [hDivideBCDDivisor + 2], a
+ ld a, [hDivideBCDDivisor + 1]
and $f
ld b, a
ld a, [hDivideBCDDivisor]
@@ -135,7 +139,7 @@ DivideBCD_divDivisorBy10:
ld [hDivideBCDDivisor], a
and $f0
or b
- ld [hDivideBCDDivisor+1], a
+ ld [hDivideBCDDivisor + 1], a
ld a, [hDivideBCDDivisor]
and $f
ld [hDivideBCDDivisor], a
@@ -151,8 +155,8 @@ DivideBCD_getNextDigit:
pop bc
ret c
inc b
- ld de, hMoney+2 ; since SubBCD works starting from the least significant digit
- ld hl, hDivideBCDDivisor+2
+ ld de, hMoney + 2 ; since SubBCD works starting from the least significant digit
+ ld hl, hDivideBCDDivisor + 2
push bc
call SubBCD
pop bc
diff --git a/engine/bg_map_attributes.asm b/engine/bg_map_attributes.asm
new file mode 100644
index 00000000..90df9e27
--- /dev/null
+++ b/engine/bg_map_attributes.asm
@@ -0,0 +1,219 @@
+INCLUDE "data/bg_map_attributes.asm"
+
+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
+ ld [rVBK], a
+ push hl
+ ld a, [hl]
+ ld c, a ; save attribute count for later
+ ld de, $10
+ add hl, de
+ ld a, h
+ ld [rHDMA1], a
+ ld a, l
+ ld [rHDMA2], a
+ ld de, vBGMap0
+ ld a, d
+ ld [rHDMA3], a
+ ld a, e
+ ld [rHDMA4], a
+
+ ld a, [rLCDC]
+ and rLCDC_ENABLE_MASK ; is LCD off?
+ jr z, .lcdOff ; if off, transfer immediately
+; wait for VBlank if LCD is on
+.waitForVBlankLoop1
+ ld a, [rLY]
+ cp $90
+ jr nz, .waitForVBlankLoop1
+.waitForAccessibleVRAMLoop1
+ ld 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
+ ld [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
+ ld [rHDMA1], a
+ ld a, l
+ ld [rHDMA2], a
+ ld de, vBGMap1 ; copy to vBGMap1
+ ld a, d
+ ld [rHDMA3], a
+ ld a, e
+ ld [rHDMA4], a
+; LCD check again
+ ld a, [rLCDC]
+ and rLCDC_ENABLE_MASK ; is LCD off?
+ jr z, .lcdOff2 ; if off, transfer immediately
+; wait for VBlank if LCD is on
+.waitForVBlankLoop2
+ ld a, [rLY]
+ cp $90
+ jr nz, .waitForVBlankLoop2
+.waitForAccessibleVRAMLoop2
+ ld 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
+ ld [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
+ ld a, [rIF]
+ res VBLANK, a
+ ld [rIF], a
+ xor a
+ ld [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/black_out.asm b/engine/black_out.asm
index 6c358ce3..0daa084b 100644
--- a/engine/black_out.asm
+++ b/engine/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/cable_club.asm b/engine/cable_club.asm
index 3e72daa9..a8dc5d8d 100755
--- a/engine/cable_club.asm
+++ b/engine/cable_club.asm
@@ -10,8 +10,7 @@ CableClub_DoBattleOrTrade:
call LoadHpBarAndStatusTilePatterns
call LoadTrainerInfoTextBoxTiles
coord hl, 3, 8
- ld b, 2
- ld c, 12
+ lb bc, 2, 12
call CableClub_TextBoxBorder
coord hl, 4, 10
ld de, PleaseWaitString
@@ -119,6 +118,7 @@ CableClub_DoBattleOrTradeAgain:
ld [rSC], a
.skipSendingTwoZeroBytes
call Delay3
+ call StopAllMusic
ld a, (1 << SERIAL)
ld [rIE], a
ld hl, wSerialRandomNumberListBlock
@@ -139,8 +139,6 @@ CableClub_DoBattleOrTradeAgain:
call Serial_ExchangeBytes
ld a, (1 << SERIAL) | (1 << TIMER) | (1 << VBLANK)
ld [rIE], a
- ld a, $ff
- call PlaySound
ld 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, $ff
- call PlaySound
+ call StopAllMusic
ld 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
@@ -338,10 +346,10 @@ TradeCenter_SelectMon:
ld a, 1
ld [wTopMenuItemX], a
.enemyMonMenu_HandleInput
- ld hl, hFlags_0xFFF6
+ ld hl, hFlags_0xFFFA
set 1, [hl]
call HandleMenuInput
- ld hl, hFlags_0xFFF6
+ ld hl, hFlags_0xFFFA
res 1, [hl]
and a
jp z, .getNewInput
@@ -403,10 +411,10 @@ TradeCenter_SelectMon:
lb bc, 6, 1
call ClearScreenArea
.playerMonMenu_HandleInput
- ld hl, hFlags_0xFFF6
+ ld hl, hFlags_0xFFFA
set 1, [hl]
call HandleMenuInput
- ld hl, hFlags_0xFFF6
+ ld hl, hFlags_0xFFFA
res 1, [hl]
and a ; was anything pressed?
jr nz, .playerMonMenu_SomethingPressed
@@ -465,8 +473,7 @@ TradeCenter_SelectMon:
.displayStatsTradeMenu
push af
coord hl, 0, 14
- ld b, 2
- ld c, 18
+ lb bc, 2, 18
call CableClub_TextBoxBorder
coord hl, 2, 16
ld de, .statsTrade
@@ -601,8 +608,7 @@ TradeCenter_DrawCancelBox:
ld bc, 2 * SCREEN_WIDTH + 9
call FillMemory
coord hl, 0, 15
- ld b, 1
- ld c, 9
+ lb bc, 1, 9
call CableClub_TextBoxBorder
coord hl, 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:
coord hl, 0, 0
- ld b, 6
- ld c, 18
+ lb bc, 6, 18
call CableClub_TextBoxBorder
coord hl, 0, 8
- ld b, 6
- ld c, 18
+ lb bc, 6, 18
call CableClub_TextBoxBorder
coord hl, 5, 0
ld de, wPlayerName
@@ -685,8 +692,7 @@ TradeCenter_Trade:
ld [wMenuWatchMovingOutOfBounds], a
ld [wMenuJoypadPollCount], a
coord hl, 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
coord hl, 0, 12
- ld b, 4
- ld c, 18
+ lb bc, 4, 18
call CableClub_TextBoxBorder
coord hl, 1, 14
ld de, TradeCanceled
@@ -744,8 +749,7 @@ TradeCenter_Trade:
jr nz, .doTrade
; if the other person cancelled
coord hl, 0, 12
- ld b, 4
- ld c, 18
+ lb bc, 4, 18
call CableClub_TextBoxBorder
coord hl, 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
@@ -826,7 +831,7 @@ TradeCenter_Trade:
ld [wTradedEnemyMonSpecies], a
ld a, 10
ld [wAudioFadeOutControl], a
- ld a, $2
+ ld a, BANK(Music_SafariZone)
ld [wAudioSavedROMBank], a
ld a, MUSIC_SAFARI_ZONE
ld [wNewSoundID], a
@@ -851,9 +856,11 @@ TradeCenter_Trade:
call Serial_PrintWaitingTextAndSyncAndExchangeNybble
ld c, 40
call DelayFrames
+ call Delay3
+ ld b, $9
+ call RunPaletteCommand
coord hl, 0, 12
- ld b, 4
- ld c, 18
+ lb bc, 4, 18
call CableClub_TextBoxBorder
coord hl, 1, 14
ld de, TradeCompleted
diff --git a/engine/clear_save.asm b/engine/clear_save.asm
index b47cd6c4..f2acbf32 100755
--- a/engine/clear_save.asm
+++ b/engine/clear_save.asm
@@ -5,6 +5,8 @@ DoClearSaveDialogue:
call LoadTextBoxTilePatterns
ld hl, ClearSaveDataText
call PrintText
+ ld a, B_BUTTON
+ ld [wJoyIgnore], a
coord hl, 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/debug1.asm b/engine/debug1.asm
index a5eb7dde..a39e8cac 100644
--- a/engine/debug1.asm
+++ b/engine/debug1.asm
@@ -1,14 +1,6 @@
-; This function appears to never be used.
-; It is likely 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 $ff
@@ -21,12 +13,11 @@ SetIshiharaTeam:
call AddPartyMon
jr .loop
-IshiharaTeam:
- db EXEGGUTOR,90
- db MEW,20
- db JOLTEON,56
- db DUGTRIO,56
- db ARTICUNO,57
+DebugTeam:
+ db SNORLAX,80
+ db PERSIAN,80
+ db JIGGLYPUFF,15
+ db PIKACHU,5
db $FF
EmptyFunc:
diff --git a/engine/diploma_3a.asm b/engine/diploma_3a.asm
new file mode 100755
index 00000000..f4504ad7
--- /dev/null
+++ b/engine/diploma_3a.asm
@@ -0,0 +1,166 @@
+_DisplayDiploma:
+ call GBPalWhiteOutWithDelay3
+ call ClearScreen
+ ld de, SurfingPikachu3Graphics
+ ld hl, vChars2
+ lb bc, BANK(SurfingPikachu3Graphics), (SurfingPikachu3GraphicsEnd - SurfingPikachu3Graphics) / $10
+ call CopyVideoData
+
+ coord hl, 0, 0
+ call Func_e9bdf
+
+ coord hl, 0, 0
+ call Func_e9beb
+
+ coord hl, 19, 0
+ call Func_e9beb
+
+ ld a, $00
+ coord hl, 0, 0
+ ld [hl], a
+ coord hl, 19, 0
+ ld [hl], a
+
+ ld de, String_e9a73
+ coord hl, 5, 2
+ call PlaceString
+
+ ld de, String_e9a7d
+ coord hl, 3, 4
+ call PlaceString
+
+ ld de, wPlayerName
+ coord hl, 10, 4
+ call PlaceString
+
+ ld de, String_e9a84
+ coord hl, 2, 6
+ call PlaceString
+
+ ld de, String_e9ac8
+ coord hl, 9, 16
+ call PlaceString
+
+ ld b, SET_PAL_GENERIC
+ call RunPaletteCommand
+ ld a, $01
+ ld [$ffba], a
+ call Delay3
+ call GBPalNormal
+ ret
+
+String_e9a73:
+ db $10, "Diploma", $10, "@"
+
+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
+ coord hl, 0, 17
+ call Func_e9bdf
+ coord hl, 0, 0
+ call Func_e9beb
+ coord hl, 19, 0
+ call Func_e9beb
+ ld a, $00
+ coord hl, 0, 17
+ ld [hl], a
+ coord hl, 19, 17
+ ld [hl], a
+ ld de, Tilemap_e9b3e
+ coord hl, 6, 2
+ lb bc, 10, 12
+ call Diploma_Surfing_CopyBox
+ ld de, Tilemap_e9bb6
+ coord hl, 5, 13
+ lb bc, 1, 11
+ call Diploma_Surfing_CopyBox
+ ld de, String_e9bd5
+ coord hl, 2, 15
+ call PlaceString
+ coord hl, 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
+ coord hl, 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
diff --git a/engine/display_text_id_init.asm b/engine/display_text_id_init.asm
index 59b3a5f8..0ef37370 100644
--- a/engine/display_text_id_init.asm
+++ b/engine/display_text_id_init.asm
@@ -14,19 +14,16 @@ DisplayTextIDInit:
CheckEvent EVENT_GOT_POKEDEX
; start menu with pokedex
coord hl, 10, 0
- ld b, $0e
- ld c, $08
+ lb bc, 14, 8
jr nz, .drawTextBoxBorder
; start menu without pokedex
coord hl, 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
coord hl, 0, 12
- ld b, $04
- ld c, $12
+ lb bc, 4, 18
.drawTextBoxBorder
call TextBoxBorder
.skipDrawingTextBoxBorder
diff --git a/engine/evolution.asm b/engine/evolution.asm
index 731735c5..7277e991 100755
--- a/engine/evolution.asm
+++ b/engine/evolution.asm
@@ -9,9 +9,7 @@ EvolveMon:
xor a
ld [wLowHealthAlarm], a
ld [wChannelSoundIDs + Ch5], a
- dec a
- ld [wNewSoundID], a
- call PlaySound
+ call StopAllMusic
ld a, $1
ld [H_AUTOBGTRANSFERENABLED], a
ld a, SFX_TINK
@@ -67,9 +65,7 @@ EvolveMon:
ld a, [wEvoNewSpecies]
.done
ld [wWholeScreenPaletteMonSpecies], a
- ld a, $ff
- ld [wNewSoundID], a
- call PlaySound
+ call StopAllMusic
ld a, [wWholeScreenPaletteMonSpecies]
call PlayCry
ld c, 0
diff --git a/engine/evolve_trade.asm b/engine/evolve_trade.asm
deleted file mode 100755
index e17fc05c..00000000
--- a/engine/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
- callab TryEvolvingMon
- xor a ; LINK_STATE_NONE
- ld [wLinkState], a
- jp PlayDefaultMusic
diff --git a/engine/evos_moves.asm b/engine/evos_moves.asm
index f50f8081..8ec2c4c7 100755
--- a/engine/evos_moves.asm
+++ b/engine/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,180 @@ LearnMoveFromLevelUp:
call GetMoveName
call CopyStringToCF4B
predef LearnMove
+ ld a, b
+ and a
+ jr z, .done
+ callab 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
+
+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 $ff
+
+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 +648,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/evos_moves.asm"
diff --git a/engine/gamefreak.asm b/engine/gamefreak.asm
index 5226072b..5472a56e 100755
--- a/engine/gamefreak.asm
+++ b/engine/gamefreak.asm
@@ -3,6 +3,8 @@ LoadShootingStarGraphics:
ld [rOBP0], a
ld a, $a4
ld [rOBP1], a
+ call UpdateGBCPal_OBP0
+ call UpdateGBCPal_OBP1
ld de, AnimationTileset2 + $30 ; star tile (top left quadrant)
ld hl, vChars1 + $200
lb bc, BANK(AnimationTileset2), $01
@@ -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,27 +174,35 @@ 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 $FF
@@ -204,7 +224,7 @@ MoveDownSmallStars:
ld a, [rOBP1]
xor %10100000
ld [rOBP1], a
-
+ call UpdateGBCPal_OBP1
ld c, 3
call CheckForUserInterruption
ret c
@@ -232,10 +252,10 @@ GameFreakLogoOAMData:
GameFreakLogoOAMDataEnd:
GameFreakShootingStarOAMData:
- db $00,$A0,$A0,$10
- db $00,$A8,$A0,$30
- db $08,$A0,$A1,$10
- db $08,$A8,$A1,$30
+ db $00,$A0,$A0,$14
+ db $00,$A8,$A0,$34
+ db $08,$A0,$A1,$14
+ db $08,$A8,$A1,$34
GameFreakShootingStarOAMDataEnd:
FallingStar:
diff --git a/engine/give_pokemon.asm b/engine/give_pokemon.asm
index 49596782..6fdca2ef 100755
--- a/engine/give_pokemon.asm
+++ b/engine/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:
+ db "@"
+
GotMonText:
TX_FAR _GotMonText
TX_SFX_ITEM_1
diff --git a/engine/hall_of_fame.asm b/engine/hall_of_fame.asm
index 3c9b1723..39a7a2e3 100755
--- a/engine/hall_of_fame.asm
+++ b/engine/hall_of_fame.asm
@@ -58,8 +58,7 @@ AnimateHallOfFame:
ld c, 80
call DelayFrames
coord hl, 2, 13
- ld b, 3
- ld c, 14
+ lb bc, 3, 14
call TextBoxBorder
coord hl, 4, 15
ld de, HallOfFameText
@@ -77,7 +76,7 @@ AnimateHallOfFame:
ld bc, HOF_MON
call AddNTimes
ld [hl], $ff
- call SaveHallOfFameTeams
+ callab SaveHallOfFameTeams ; useless since in same bank
xor a
ld [wHoFMonSpecies], a
inc a
@@ -122,6 +121,7 @@ HoFShowMonOrPlayer:
call RunPaletteCommand
ld a, %11100100
ld [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
+ callab IsThisPartymonStarterPikachu_Party
+ jr nc, .asm_70336
+ ld e, $22
+ callab 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:
coord hl, 0, 2
- ld b, 9
- ld c, 10
+ lb bc, 9, 10
call TextBoxBorder
coord hl, 2, 6
ld de, HoFMonInfoText
@@ -174,8 +189,7 @@ HoFDisplayMonInfo:
ld [wd0b5], a
coord hl, 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
coord hl, 0, 4
- ld b, 6
- ld c, 10
+ lb bc, 6, 10
call TextBoxBorder
coord hl, 5, 0
- ld b, 2
- ld c, 9
+ lb bc, 2, 9
call TextBoxBorder
coord hl, 7, 2
ld de, wPlayerName
diff --git a/engine/hidden_object_functions14.asm b/engine/hidden_object_functions14.asm
index f8cdf44e..04f9cb35 100755
--- a/engine/hidden_object_functions14.asm
+++ b/engine/hidden_object_functions14.asm
@@ -89,7 +89,7 @@ FightingDojoText:
db "@"
PrintIndigoPlateauHQText:
- ld a, [wSpriteStateData1 + 9]
+ ld a, [wSpritePlayerStateData1FacingDirection]
cp SPRITE_FACING_UP
ret nz
call EnableAutoTextBoxDrawing
diff --git a/engine/hidden_object_functions17.asm b/engine/hidden_object_functions17.asm
index c1fa5aa4..8775fd39 100755
--- a/engine/hidden_object_functions17.asm
+++ b/engine/hidden_object_functions17.asm
@@ -14,7 +14,7 @@ RedBedroomPCText:
TX_PLAYERS_PC
Route15GateLeftBinoculars:
- ld a, [wSpriteStateData1 + 9]
+ ld a, [wSpritePlayerStateData1FacingDirection]
cp SPRITE_FACING_UP
ret nz
call EnableAutoTextBoxDrawing
@@ -22,7 +22,10 @@ Route15GateLeftBinoculars:
ld a, ARTICUNO
ld [wcf91], a
call PlayCry
- jp DisplayMonFrontSpriteInBox
+ call DisplayMonFrontSpriteInBox
+ xor a
+ ld [H_AUTOBGTRANSFERENABLED], a
+ ret
Route15UpstairsBinocularsText:
TX_FAR _Route15UpstairsBinocularsText
@@ -52,6 +55,30 @@ KabutopsFossilText:
TX_FAR _KabutopsFossilText
db "@"
+FanClubPicture1:
+ ld a, RAPIDASH
+ ld [wcf91], a
+ call DisplayMonFrontSpriteInBox
+ call EnableAutoTextBoxDrawing
+ tx_pre FanClubPicture1Text
+ ret
+
+FanClubPicture1Text:
+ TX_FAR _FanClubPicture1Text
+ db "@"
+
+FanClubPicture2:
+ ld a, FEAROW
+ ld [wcf91], a
+ call DisplayMonFrontSpriteInBox
+ call EnableAutoTextBoxDrawing
+ tx_pre FanClubPicture2Text
+ ret
+
+FanClubPicture2Text:
+ TX_FAR _FanClubPicture2Text
+ db "@"
+
DisplayMonFrontSpriteInBox:
; Displays a pokemon's front sprite in a pop-up window.
; [wcf91] = pokemon internal id number
@@ -110,8 +137,7 @@ LinkCableHelp:
ld hl, wd730
set 6, [hl]
coord hl, 0, 0
- ld b, 8
- ld c, 13
+ lb bc, 8, 13
call TextBoxBorder
coord hl, 2, 2
ld de, HowToLinkText
@@ -339,53 +365,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.
-
- ld [hGymTrashCanRandNumMask], a
- push hl
- call Random
- swap a
- ld b, a
- ld 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
-
+ callab 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
@@ -413,25 +403,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:
TX_FAR _VermilionGymTrashSuccessText1
diff --git a/engine/hidden_object_functions18.asm b/engine/hidden_object_functions18.asm
index c6fb3109..3fd5dd47 100755
--- a/engine/hidden_object_functions18.asm
+++ b/engine/hidden_object_functions18.asm
@@ -3,7 +3,7 @@ GymStatues:
; if in a gym and don’t have the corresponding badge, a = GymStatueText1_id and jp PrintPredefTextID
; else ret
call EnableAutoTextBoxDrawing
- ld a, [wSpriteStateData1 + 9]
+ ld a, [wSpritePlayerStateData1FacingDirection]
cp SPRITE_FACING_UP
ret nz
ld hl, .BadgeFlags
@@ -29,14 +29,14 @@ GymStatues:
jp PrintPredefTextID
.BadgeFlags:
- db PEWTER_GYM, %00000001
- db CERULEAN_GYM, %00000010
- db VERMILION_GYM,%00000100
- db CELADON_GYM, %00001000
- db FUCHSIA_GYM, %00010000
- db SAFFRON_GYM, %00100000
- db CINNABAR_GYM, %01000000
- db VIRIDIAN_GYM, %10000000
+ db PEWTER_GYM, %00000001
+ db CERULEAN_GYM, %00000010
+ db VERMILION_GYM, %00000100
+ db CELADON_GYM, %00001000
+ db FUCHSIA_GYM, %00010000
+ db SAFFRON_GYM, %00100000
+ db CINNABAR_GYM, %01000000
+ db VIRIDIAN_GYM, %10000000
db $ff
GymStatueText1:
@@ -64,7 +64,7 @@ PrintBenchGuyText:
.match
ld a, [hli]
ld b, a
- ld a, [wSpriteStateData1 + 9]
+ ld a, [wSpritePlayerStateData1FacingDirection]
cp b
jr nz, .loop ; player isn't facing left at the bench guy
ld a, [hl]
@@ -72,30 +72,36 @@ PrintBenchGuyText:
; format: db map id, player sprite facing direction, text id of PredefTextIDPointerTable
BenchGuyTextPointers:
- db VIRIDIAN_POKECENTER, SPRITE_FACING_LEFT
+ db VIRIDIAN_POKECENTER, SPRITE_FACING_LEFT
db_tx_pre ViridianCityPokecenterBenchGuyText
- db PEWTER_POKECENTER, SPRITE_FACING_LEFT
+ db PEWTER_POKECENTER, SPRITE_FACING_LEFT
db_tx_pre PewterCityPokecenterBenchGuyText
- db CERULEAN_POKECENTER, SPRITE_FACING_LEFT
+ db CERULEAN_POKECENTER, SPRITE_FACING_LEFT
db_tx_pre CeruleanCityPokecenterBenchGuyText
- db LAVENDER_POKECENTER, SPRITE_FACING_LEFT
+ db LAVENDER_POKECENTER, SPRITE_FACING_LEFT
db_tx_pre LavenderCityPokecenterBenchGuyText
- db VERMILION_POKECENTER, SPRITE_FACING_LEFT
+ db VERMILION_POKECENTER, SPRITE_FACING_LEFT
db_tx_pre VermilionCityPokecenterBenchGuyText
- db CELADON_POKECENTER, SPRITE_FACING_LEFT
+ db CELADON_POKECENTER, SPRITE_FACING_LEFT
db_tx_pre CeladonCityPokecenterBenchGuyText
- db CELADON_HOTEL, SPRITE_FACING_LEFT
+ db CELADON_HOTEL, SPRITE_FACING_LEFT
db_tx_pre CeladonCityHotelText
- db FUCHSIA_POKECENTER, SPRITE_FACING_LEFT
+ db FUCHSIA_POKECENTER, SPRITE_FACING_LEFT
db_tx_pre FuchsiaCityPokecenterBenchGuyText
- db CINNABAR_POKECENTER, SPRITE_FACING_LEFT
+ db CINNABAR_POKECENTER, SPRITE_FACING_LEFT
db_tx_pre CinnabarIslandPokecenterBenchGuyText
- db SAFFRON_POKECENTER, SPRITE_FACING_LEFT
+ db SAFFRON_POKECENTER, SPRITE_FACING_LEFT
db_tx_pre SaffronCityPokecenterBenchGuyText
- db MT_MOON_POKECENTER, SPRITE_FACING_LEFT
+ db MT_MOON_POKECENTER, SPRITE_FACING_LEFT
db_tx_pre MtMoonPokecenterBenchGuyText
- db ROCK_TUNNEL_POKECENTER,SPRITE_FACING_LEFT
+ db ROCK_TUNNEL_POKECENTER, SPRITE_FACING_LEFT
db_tx_pre RockTunnelPokecenterBenchGuyText
+ db SAFARI_ZONE_WEST_REST_HOUSE,SPRITE_FACING_LEFT
+ db_tx_pre UnusedBenchGuyText1
+ db SAFARI_ZONE_EAST_REST_HOUSE,SPRITE_FACING_LEFT
+ db_tx_pre UnusedBenchGuyText2
+ db SAFARI_ZONE_NORTH_REST_HOUSE,SPRITE_FACING_LEFT
+ db_tx_pre UnusedBenchGuyText3
db $FF
ViridianCityPokecenterBenchGuyText:
@@ -186,7 +192,7 @@ BookcaseText:
db "@"
OpenPokemonCenterPC:
- ld a, [wSpriteStateData1 + 9]
+ ld a, [wSpritePlayerStateData1FacingDirection]
cp SPRITE_FACING_UP ; check to see if player is facing up
ret nz
call EnableAutoTextBoxDrawing
diff --git a/engine/hidden_object_functions3.asm b/engine/hidden_object_functions3.asm
index aaedcbca..11aecd5b 100755
--- a/engine/hidden_object_functions3.asm
+++ b/engine/hidden_object_functions3.asm
@@ -1,6 +1,6 @@
; prints text for bookshelves in buildings without sign events
PrintBookshelfText:
- ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction
+ ld a, [wSpritePlayerStateData1FacingDirection] ; player's sprite facing direction
cp SPRITE_FACING_UP
jr nz, .noMatch
; facing up
diff --git a/engine/hidden_object_functions7.asm b/engine/hidden_object_functions7.asm
index 89be94fc..2498c167 100755
--- a/engine/hidden_object_functions7.asm
+++ b/engine/hidden_object_functions7.asm
@@ -65,8 +65,7 @@ SafariZoneGameOver:
call EnableAutoTextBoxDrawing
xor a
ld [wAudioFadeOutControl], a
- dec a
- call PlaySound
+ call StopAllMusic
ld c, BANK(SFX_Safari_Zone_PA)
ld a, SFX_SAFARI_ZONE_PA
call PlayMusic
@@ -117,7 +116,7 @@ GameOverText:
db "@"
PrintCinnabarQuiz:
- ld a, [wSpriteStateData1 + 9]
+ ld a, [wSpritePlayerStateData1FacingDirection]
cp SPRITE_FACING_UP
ret nz
call EnableAutoTextBoxDrawing
@@ -127,6 +126,8 @@ CinnabarGymQuiz:
TX_ASM
xor a
ld [wOpponentAfterWrongAnswer], a
+ ld hl, wd475
+ res 7, [hl]
ld a, [wHiddenObjectFunctionArgument]
push af
and $f
@@ -135,7 +136,12 @@ CinnabarGymQuiz:
and $f0
swap a
ld [$ffdc], a
+ ld a, [hGymGateIndex]
ld hl, CinnabarGymQuizIntroText
+ cp 1
+ jr z, .onFirstQuestion
+ ld hl, CinnabarGymQuizShortIntroText
+.onFirstQuestion
call PrintText
ld a, [hGymGateIndex]
dec a
@@ -153,10 +159,18 @@ CinnabarGymQuiz:
call CinnabarGymQuiz_1ea92
jp TextScriptEnd
+CinnabarGymQuizDummyIntroText:
+ TX_FAR _CinnabarGymQuizDummyIntroText
+ db "@"
+
CinnabarGymQuizIntroText:
TX_FAR _CinnabarGymQuizIntroText
db "@"
+CinnabarGymQuizShortIntroText:
+ TX_FAR _CinnabarGymQuizShortIntroText
+ db "@"
+
CinnabarQuizQuestions:
dw CinnabarQuizQuestionsText1
dw CinnabarQuizQuestionsText2
@@ -189,10 +203,6 @@ CinnabarQuizQuestionsText6:
TX_FAR _CinnabarQuizQuestionsText6
db "@"
-CinnabarGymGateFlagAction:
- EventFlagAddress hl, EVENT_CINNABAR_GYM_GATE0_UNLOCKED
- predef_jump FlagActionPredef
-
CinnabarGymQuiz_1ea92:
call YesNoChoice
ld a, [$ffdc]
@@ -232,6 +242,8 @@ CinnabarGymQuiz_1ea92:
ld a, [hGymGateIndex]
add $2
ld [wOpponentAfterWrongAnswer], a
+ ld hl, wd475
+ set 7, [hl]
ret
CinnabarGymQuizCorrectText:
@@ -258,6 +270,10 @@ CinnabarGymQuizIncorrectText:
TX_FAR _CinnabarGymQuizIncorrectText
db "@"
+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.
@@ -295,10 +311,11 @@ UpdateCinnabarGymGateTileBlocks_:
.next
pop bc
ld [wNewTileBlockID], a
- predef ReplaceTileBlock
+ call CinnabarGym_ReplaceTileBlock
ld hl, hGymGateIndex
dec [hl]
jr nz, .loop
+ callab RedrawMapView
ret
CinnabarGymGateCoords:
@@ -311,6 +328,34 @@ CinnabarGymGateCoords:
db $02,$06,$54,$00
db $02,$03,$54,$00
+
+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
+
PrintMagazinesText:
call EnableAutoTextBoxDrawing
tx_pre MagazinesText
@@ -322,7 +367,7 @@ MagazinesText:
BillsHousePC:
call EnableAutoTextBoxDrawing
- ld a, [wSpriteStateData1 + 9]
+ ld a, [wSpritePlayerStateData1FacingDirection]
cp SPRITE_FACING_UP
ret nz
CheckEvent EVENT_LEFT_BILLS_HOUSE_AFTER_HELPING
@@ -374,9 +419,7 @@ BillsHouseInitiatedText:
TX_FAR _BillsHouseInitiatedText
TX_BLINK
TX_ASM
- ld a, $ff
- ld [wNewSoundID], a
- call PlaySound
+ call StopAllMusic
ld c, 16
call DelayFrames
ld a, SFX_SWITCH
@@ -407,8 +450,7 @@ BillsHousePokemonList:
ld hl, wd730
set 6, [hl]
coord hl, 0, 0
- ld b, 10
- ld c, 9
+ lb bc, 10, 9
call TextBoxBorder
coord hl, 2, 2
ld de, BillsMonListText
@@ -456,11 +498,12 @@ BillsHousePokemonListText2:
db "@"
DisplayOakLabEmailText:
- ld a, [wSpriteStateData1 + 9]
+ ld a, [wSpritePlayerStateData1FacingDirection]
cp SPRITE_FACING_UP
ret nz
call EnableAutoTextBoxDrawing
- tx_pre_jump OakLabEmailText
+ tx_pre OakLabEmailText
+ ret
OakLabEmailText:
TX_FAR _OakLabEmailText
diff --git a/engine/hp_bar.asm b/engine/hp_bar.asm
index 221bd7a9..566a7b61 100755
--- a/engine/hp_bar.asm
+++ b/engine/hp_bar.asm
@@ -213,13 +213,11 @@ UpdateHPBar_PrintHPNumber:
ld a, [wHPBarOldHP + 1]
ld [wHPBarTempHP], a
push hl
- ld a, [hFlags_0xFFF6]
+ ld de, $15
+ ld a, [hFlags_0xFFFA]
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/in_game_trades.asm b/engine/in_game_trades.asm
index c01bc3c3..720920df 100755
--- a/engine/in_game_trades.asm
+++ b/engine/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
- callab EvolveTradeMon
+ call InGameTrade_CheckForTradeEvo
call ClearScreen
call InGameTrade_RestoreScreen
callba 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
+ callab EvolveTradeMon
+ xor a ; LINK_STATE_NONE
+ ld [wLinkState],a
+ jp PlayDefaultMusic
+
InGameTrade_TrainerString:
; "TRAINER@@@@@@@@@@"
db $5d, "@@@@@@@@@@"
diff --git a/engine/init_player_data.asm b/engine/init_player_data.asm
index c576e65a..5883547c 100644
--- a/engine/init_player_data.asm
+++ b/engine/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, wNumInBox
diff --git a/engine/intro.asm b/engine/intro.asm
index a016b365..00e892da 100755
--- a/engine/intro.asm
+++ b/engine/intro.asm
@@ -16,8 +16,7 @@ PlayIntro:
inc a
ld [H_AUTOBGTRANSFERENABLED], a
call PlayShootingStar
- call PlayIntroScene
- call GBFadeOutToWhite
+ callab PlayIntroScene
xor a
ld [hSCX], a
ld [H_AUTOBGTRANSFERENABLED], a
@@ -25,162 +24,6 @@ PlayIntro:
call DelayFrame
ret
-PlayIntroScene:
- ld b, SET_PAL_NIDORINO_INTRO
- call RunPaletteCommand
- ldPal a, BLACK, DARK_GRAY, LIGHT_GRAY, WHITE
- ld [rBGP], a
- ld [rOBP0], a
- ld [rOBP1], a
- xor a
- ld [hSCX], a
- ld b, GENGAR_INTRO_TILES1
- 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, GENGAR_INTRO_TILES2
- 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, GENGAR_INTRO_TILES3
- 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) / BYTES_PER_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, GENGAR_INTRO_TILES1
- 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) / BYTES_PER_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) / BYTES_PER_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
@@ -237,83 +80,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
- ld 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
- ld a, [hSCX]
- inc a
- inc a
-.next
- ld [hSCX], a
- push de
- ld c, 2
- call CheckForUserInterruption
- pop de
- ret c
- dec d
- jr nz, IntroMoveMon
- ret
-
-IntroCopyTiles:
- coord hl, 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
callba LoadCopyrightAndTextBoxTiles
ldPal a, BLACK, DARK_GRAY, LIGHT_GRAY, WHITE
ld [rBGP], a
+ call UpdateGBCPal_BGP
ld c, 180
call DelayFrames
call ClearScreen
@@ -321,7 +98,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]
@@ -335,12 +132,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
@@ -364,79 +155,6 @@ IntroDrawBlackBars:
EmptyFunc4:
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/gamefreak_intro.2bpp"
INCBIN "gfx/gamefreak_logo.2bpp"
@@ -444,29 +162,3 @@ GameFreakIntro:
db $00 ; blank tile
endr
GameFreakIntroEnd:
-
-FightIntroBackMon:
- INCBIN "gfx/intro_fight.2bpp"
-FightIntroBackMonEnd:
-
-FightIntroFrontMon:
-
-IF DEF(_RED)
- INCBIN "gfx/red/intro_nido_1.2bpp"
-FightIntroFrontMon2:
- INCBIN "gfx/red/intro_nido_2.2bpp"
-FightIntroFrontMon3:
- INCBIN "gfx/red/intro_nido_3.2bpp"
-ENDC
-
-IF DEF(_BLUE)
- INCBIN "gfx/blue/intro_purin_1.2bpp"
-FightIntroFrontMon2:
- INCBIN "gfx/blue/intro_purin_2.2bpp"
-FightIntroFrontMon3:
- INCBIN "gfx/blue/intro_purin_3.2bpp"
-ENDC
-
-FightIntroFrontMonEnd:
-
- ds $10 ; blank tile
diff --git a/engine/items/inventory.asm b/engine/items/inventory.asm
index d07f64eb..58bcf7e9 100644
--- a/engine/items/inventory.asm
+++ b/engine/items/inventory.asm
@@ -27,16 +27,17 @@ AddItemToInventory_:
ld a, [hli]
and a
jr z, .addNewItem
-.loop
+.notAtEndOfInventory
ld a, [hli]
ld b, a ; b = ID of current item in table
ld a, [wcf91] ; a = ID of item being added
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
+.loop
ld a, [hl]
- cp $ff ; is it the end of the table?
- jr nz, .loop
+ cp a, $ff ; is it the end of the table?
+ jr nz, .notAtEndOfInventory
.addNewItem ; add an item not yet in the inventory
pop hl
ld a, d
@@ -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/items.asm b/engine/items/items.asm
index ec51a0d4..15c7c24f 100755
--- a/engine/items/items.asm
+++ b/engine/items/items.asm
@@ -113,7 +113,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?
@@ -152,16 +154,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.
@@ -280,6 +292,7 @@ ItemUseBall:
inc a
.skip2
+
; Let W = ((MaxHP * 255) / BallFactor) / max(HP / 4, 1). Calculate W.
ld [H_DIVISOR], a
ld b, 4
@@ -347,6 +360,7 @@ ItemUseBall:
jr z, .skip4
.skip4
+
; Let Y = (CatchRate * 100) / BallFactor2. Calculate Y.
ld a, b
ld [H_DIVISOR], a
@@ -371,7 +385,7 @@ ItemUseBall:
ld [H_DIVISOR], a
ld b, 4
call Divide
-
+
; Determine Status2.
; no status ailment: Status2 = 0
; Burn/Paralysis/Poison: Status2 = 5
@@ -511,9 +525,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
@@ -545,12 +560,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
@@ -583,6 +604,9 @@ ItemUseBall:
ld [wItemQuantity], a
jp RemoveItemFromInventory
+.emptyString
+ db "@"
+
ItemUseBallText00:
;"It dodged the thrown ball!"
;"This pokemon can't be caught"
@@ -648,21 +672,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
ld [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:
@@ -672,7 +703,7 @@ ItemUseSurfboard:
jr z, .tryToStopSurfing
.tryToSurf
call IsNextTileShoreOrWater
- jp c, SurfingAttemptFailed
+ jp nc, SurfingAttemptFailed
ld hl, TilePairCollisionsWater
call CheckForTilePairCollisions
jp c, SurfingAttemptFailed
@@ -685,6 +716,7 @@ ItemUseSurfboard:
call PlayDefaultMusic ; play surfing music
ld hl, SurfingGotOnText
jp PrintText
+
.tryToStopSurfing
xor a
ld [hSpriteIndexOrTextID], a
@@ -697,23 +729,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
@@ -721,7 +750,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
@@ -769,25 +800,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
+ callab IsThisPartymonStarterPikachu_Party
+ jr nc, .notPlayerPikachu
+ ld e, $1b
+ callab 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
callab 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
@@ -796,6 +845,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:
+ TX_FAR _RefusingText
+ db "@"
+
ItemUseVitamin:
ld a, [wIsInBattle]
and a
@@ -804,7 +902,7 @@ ItemUseVitamin:
ItemUseMedicine:
ld a, [wPartyCount]
and a
- jp z, .emptyParty
+ jp z, Func_e4bf
ld a, [wWhichPokemon]
push af
ld a, [wcf91]
@@ -819,15 +917,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
@@ -843,6 +932,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
@@ -910,6 +1009,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]
@@ -927,7 +1027,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
+ callab Func_2fd6a
+ pop bc
+ pop de
+ pop hl
+ pop af
+ ld [wWhichPokemon], a
+
ld a, [wIsInBattle]
and a
jr z, .compareCurrentHPToMaxHP
@@ -952,6 +1067,7 @@ ItemUseMedicine:
pop de
pop hl
jr .compareCurrentHPToMaxHP
+
.notFainted
ld a, [wcf91]
cp REVIVE
@@ -987,6 +1103,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
@@ -1050,15 +1167,15 @@ ItemUseMedicine:
call AddNTimes ; calculate coordinates of HP bar of pokemon that used Softboiled
ld a, SFX_HEAL_HP
call PlaySoundWaitForCurrent
- ld a, [hFlags_0xFFF6]
+ ld a, [hFlags_0xFFFA]
set 0, a
- ld [hFlags_0xFFF6], a
+ ld [hFlags_0xFFFA], a
ld a, $02
ld [wHPBarType], a
predef UpdateHPBar2 ; animate HP bar decrease of pokemon that used Softboiled
- ld a, [hFlags_0xFFF6]
+ ld a, [hFlags_0xFFFA]
res 0, a
- ld [hFlags_0xFFF6], a
+ ld [hFlags_0xFFFA], a
pop af
ld b, a ; store heal amount (1/5 of max HP)
ld hl, wHPBarOldHP + 1
@@ -1071,6 +1188,7 @@ ItemUseMedicine:
pop af
ld [hl], a
jr .addHealAmount
+
.notUsingSoftboiled2
ld a, [wcf91]
cp SODA_POP
@@ -1125,6 +1243,7 @@ ItemUseMedicine:
cp MAX_REVIVE
jr z, .setCurrentHPToMaxHp ; if using a Max Revive
jr .updateInBattleData
+
.setCurrentHPToHalfMaxHP
dec hl
dec de
@@ -1139,6 +1258,7 @@ ItemUseMedicine:
ld [wHPBarNewHP], a
dec de
jr .doneHealingPartyHP
+
.setCurrentHPToMaxHp
ld a, [hli]
ld [de], a
@@ -1182,9 +1302,11 @@ ItemUseMedicine:
dec d
jr nz, .calculateHPBarCoordsLoop
jr .doneHealing
+
.healingItemNoEffect
call ItemUseNoEffect
jp .done
+
.doneHealing
ld a, [wPseudoItemID]
and a ; using Softboiled?
@@ -1200,15 +1322,15 @@ ItemUseMedicine:
jr z, .playStatusAilmentCuringSound
ld a, SFX_HEAL_HP
call PlaySoundWaitForCurrent
- ld a, [hFlags_0xFFF6]
+ ld a, [hFlags_0xFFFA]
set 0, a
- ld [hFlags_0xFFF6], a
+ ld [hFlags_0xFFFA], a
ld a, $02
ld [wHPBarType], a
predef UpdateHPBar2 ; animate the HP bar lengthening
- ld a, [hFlags_0xFFF6]
+ ld a, [hFlags_0xFFFA]
res 0, a
- ld [hFlags_0xFFF6], a
+ ld [hFlags_0xFFFA], a
ld a, REVIVE_MSG
ld [wPartyMenuTypeOrMessageID], a
ld a, [wcf91]
@@ -1219,6 +1341,7 @@ ItemUseMedicine:
ld a, POTION_MSG
ld [wPartyMenuTypeOrMessageID], a
jr .showHealingItemMessage
+
.playStatusAilmentCuringSound
ld a, SFX_HEAL_AILMENT
call PlaySoundWaitForCurrent
@@ -1235,6 +1358,7 @@ ItemUseMedicine:
call DelayFrames
call WaitForTextScrollButtonPress
jr .done
+
.canceledItemUse
xor a
ld [wActionResultOrTookBattleTurn], a ; item use failed
@@ -1250,6 +1374,7 @@ ItemUseMedicine:
and a
ret nz
jp ReloadMapData
+
.useVitamin
push hl
ld a, [hl]
@@ -1305,6 +1430,7 @@ ItemUseMedicine:
cp b
jr nz, .statNameInnerLoop
jr .statNameLoop
+
.gotStatName
ld de, wcf4b
ld bc, 10
@@ -1314,11 +1440,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
@@ -1405,9 +1533,19 @@ ItemUseMedicine:
xor a ; PLAYER_PARTY_DATA
ld [wMonDataLocation], a
predef LearnMoveFromLevelUp ; learn level up move, if any
+
xor a
ld [wForceEvolution], a
- callab TryEvolvingMon ; evolve pokemon, if appropriate
+ callabd_ModifyPikachuHappiness PIKAHAPPY_LEVELUP
+ ld a, [wWhichPokemon]
+ push af
+ ld a, [wUsedItemOnWhichPokemon]
+ ld [wWhichPokemon], a
+ callab Func_2fd6a ; evolve pokemon, if appropriate
+ pop af
+ ld [wWhichPokemon], a
+
+ callab TryEvolvingMon
ld a, $01
ld [wUpdateSpritesEnabled], a
pop af
@@ -1494,6 +1632,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
@@ -1506,6 +1648,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
@@ -1522,6 +1665,7 @@ ItemUseEscapeRope:
ld c, 30
call DelayFrames
jp RemoveUsedItem
+
.notUsable
jp ItemUseNotTime
@@ -1547,6 +1691,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.
@@ -1560,11 +1705,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
@@ -1587,6 +1734,7 @@ ItemUseCardKey:
ld a, [hl]
ld [wUnusedD71F], a
jr .done
+
.nextEntry1
inc hl
.nextEntry2
@@ -1594,6 +1742,7 @@ ItemUseCardKey:
.nextEntry3
inc hl
jr .loop
+
.done
ld hl, ItemUseText00
call PrintText
@@ -1612,34 +1761,34 @@ ItemUseCardKey:
; 03: ID?
CardKeyTable1:
- db SILPH_CO_2F,$04,$04,$00
- db SILPH_CO_2F,$04,$05,$01
- db SILPH_CO_4F,$0C,$04,$02
- db SILPH_CO_4F,$0C,$05,$03
- db SILPH_CO_7F,$06,$0A,$04
- db SILPH_CO_7F,$06,$0B,$05
- db SILPH_CO_9F,$04,$12,$06
- db SILPH_CO_9F,$04,$13,$07
- db SILPH_CO_10F,$08,$0A,$08
- db SILPH_CO_10F,$08,$0B,$09
+ db SILPH_CO_2F, $04, $04, $00
+ db SILPH_CO_2F, $04, $05, $01
+ db SILPH_CO_4F, $0C, $04, $02
+ db SILPH_CO_4F, $0C, $05, $03
+ db SILPH_CO_7F, $06, $0A, $04
+ db SILPH_CO_7F, $06, $0B, $05
+ db SILPH_CO_9F, $04, $12, $06
+ db SILPH_CO_9F, $04, $13, $07
+ db SILPH_CO_10F, $08, $0A, $08
+ db SILPH_CO_10F, $08, $0B, $09
db $ff
CardKeyTable2:
- db SILPH_CO_3F,$08,$09,$0A
- db SILPH_CO_3F,$09,$09,$0B
- db SILPH_CO_5F,$04,$07,$0C
- db SILPH_CO_5F,$05,$07,$0D
- db SILPH_CO_6F,$0C,$05,$0E
- db SILPH_CO_6F,$0D,$05,$0F
- db SILPH_CO_8F,$08,$07,$10
- db SILPH_CO_8F,$09,$07,$11
- db SILPH_CO_9F,$08,$03,$12
- db SILPH_CO_9F,$09,$03,$13
+ db SILPH_CO_3F, $08, $09, $0A
+ db SILPH_CO_3F, $09, $09, $0B
+ db SILPH_CO_5F, $04, $07, $0C
+ db SILPH_CO_5F, $05, $07, $0D
+ db SILPH_CO_6F, $0C, $05, $0E
+ db SILPH_CO_6F, $0D, $05, $0F
+ db SILPH_CO_8F, $08, $07, $10
+ db SILPH_CO_8F, $09, $07, $11
+ db SILPH_CO_9F, $08, $03, $12
+ db SILPH_CO_9F, $09, $03, $13
db $ff
CardKeyTable3:
- db SILPH_CO_11F,$08,$09,$14
- db SILPH_CO_11F,$09,$09,$15
+ db SILPH_CO_11F, $08, $09, $14
+ db SILPH_CO_11F, $09, $09, $15
db $ff
ItemUsePokedoll:
@@ -1654,6 +1803,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
@@ -1670,6 +1828,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
@@ -1682,6 +1849,7 @@ ItemUseXStat:
ld a, 2
ld [wActionResultOrTookBattleTurn], a ; item not used
ret
+
.inBattle
ld hl, wPlayerMoveNum
ld a, [hli]
@@ -1700,6 +1868,15 @@ ItemUseXStat:
xor a
ld [H_WHOSETURN], a ; set turn to player's turn
callba 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]
@@ -1717,31 +1894,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
+ callab IsPikachuRightNextToPlayer
+ jr nc, .noSnorlaxOrPikachuToWakeUp
+ ld hl, PlayedFluteHadEffectText
+ call PrintText
+ call ItemUseReloadOverworldData
+ ldpikaemotion e, PikachuEmotion26
+ callab PlaySpecificPikachuEmotion
+ ret
+
+.noSnorlaxOrPikachuToWakeUp
ld hl, PlayedFluteNoEffectText
jp PrintText
+
.inBattle
xor a
ld [wWereAnyMonsAsleep], a
@@ -1761,8 +1955,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?
@@ -1814,18 +2015,18 @@ WakeUpEntireParty:
; 00: Y
; 01: X
Route12SnorlaxFluteCoords:
- db 62,9 ; one space West of Snorlax
- db 61,10 ; one space North of Snorlax
- db 63,10 ; one space South of Snorlax
- db 62,11 ; one space East of Snorlax
+ db 62, 9 ; one space West of Snorlax
+ db 61, 10 ; one space North of Snorlax
+ db 63, 10 ; one space South of Snorlax
+ db 62, 11 ; one space East of Snorlax
db $ff ; terminator
; Format:
; 00: Y
; 01: X
Route16SnorlaxFluteCoords:
- db 10,27 ; one space East of Snorlax
- db 10,25 ; one space West of Snorlax
+ db 10, 27 ; one space East of Snorlax
+ db 10, 25 ; one space West of Snorlax
db $ff ; terminator
PlayedFluteNoEffectText:
@@ -1844,8 +2045,7 @@ PlayedFluteHadEffectText:
and a
jr nz, .done
; play out-of-battle pokeflute music
- ld a, $ff
- call PlaySound ; turn off music
+ call StopAllMusic ; turn off music
ld a, SFX_POKEFLUTE
ld c, BANK(SFX_Pokeflute)
call PlayMusic
@@ -1906,13 +2106,28 @@ INCLUDE "data/good_rod.asm"
ItemUseSuperRod:
call FishingInit
jp c, ItemUseNotTime
- call ReadSuperRodData
- ld a, e
+ callab 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
@@ -1921,7 +2136,7 @@ RodResponse:
ld a, c ; species
ld [wCurOpponent], a
-.next
+DoNotGenerateFishingEncounter:
ld hl, wWalkBikeSurfState
ld a, [hl] ; store the value in a
push af
@@ -1941,22 +2156,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
@@ -2009,7 +2230,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
@@ -2049,6 +2286,7 @@ ItemUsePPRestore:
ld hl, PPMaxedOutText
call PrintText
jr .chooseMove
+
.PPNotMaxedOut
ld a, [hl]
add 1 << 6 ; increase PP Up count by 1
@@ -2056,6 +2294,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
@@ -2064,6 +2304,7 @@ ItemUsePPRestore:
call GBPalWhiteOut
call RunDefaultPaletteCommand
jp RemoveUsedItem
+
.afterRestoringPP ; after using a (Max) Ether/Elixir
ld a, [wWhichPokemon]
ld b, a
@@ -2082,10 +2323,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
@@ -2120,6 +2363,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
@@ -2129,6 +2373,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
@@ -2232,6 +2477,7 @@ ItemUseTMHM:
ld a, 2
ld [wActionResultOrTookBattleTurn], a ; item not used
ret
+
.useMachine
ld a, [wWhichPokemon]
push af
@@ -2277,10 +2523,13 @@ ItemUseTMHM:
ld hl, MonCannotLearnMachineMoveText
call PrintText
jr .chooseMon
+
.checkIfAlreadyLearnedMove
callab 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
@@ -2288,6 +2537,28 @@ ItemUseTMHM:
ld a, b
and a
ret z
+
+ ld a, [wWhichPokemon]
+ push af
+ ld a, d
+ ld [wWhichPokemon], a
+ callabd_ModifyPikachuHappiness PIKAHAPPY_USEDTMHM
+ callab IsThisPartymonStarterPikachu_Party
+ jr nc, .notTeachingThunderboltOrThunderToPikachu
+ ld a, [wcf91]
+ cp TM_24 ; are we teaching thunderbolt to the player pikachu?
+ jr z, .teachingThunderboltOrThunderToPlayerPikachu
+ cp TM_25 ; 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
@@ -2334,6 +2605,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
@@ -2395,6 +2672,10 @@ BoxFullCannotThrowBallText:
TX_FAR _BoxFullCannotThrowBallText
db "@"
+DontHavePokemonText:
+ TX_FAR _DontHavePokemonText
+ db "@"
+
ItemUseText00:
TX_FAR _ItemUseText001
TX_LINE
@@ -2529,6 +2810,7 @@ GetMaxPP:
.sourceWithOneMon
call GetSelectedMoveOffset2
jr .next
+
.sourceWithMultipleMon
call GetSelectedMoveOffset
.next
@@ -2630,6 +2912,7 @@ TossItem_:
pop hl
and a
ret
+
.tooImportantToToss
push hl
ld hl, TooImportantToTossText
@@ -2696,7 +2979,7 @@ SendNewMonToBox:
ld a, [wcf91]
ld [wd0b5], a
ld c, a
-.asm_e7b1
+.asm_e6f5
inc de
ld a, [de]
ld b, a
@@ -2704,13 +2987,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, [wNumInBox]
dec a
- jr z, .asm_e7ee
+ jr z, .asm_e732
dec a
call AddNTimes
push hl
@@ -2722,7 +3005,7 @@ SendNewMonToBox:
ld a, [wNumInBox]
dec a
ld b, a
-.asm_e7db
+.asm_e71f
push bc
push hl
ld bc, NAME_LENGTH
@@ -2734,15 +3017,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, [wNumInBox]
dec a
- jr z, .asm_e82a
+ jr z, .asm_e76e
ld hl, wBoxMonNicks
ld bc, NAME_LENGTH
dec a
@@ -2756,7 +3039,7 @@ SendNewMonToBox:
ld a, [wNumInBox]
dec a
ld b, a
-.asm_e817
+.asm_e75b
push bc
push hl
ld bc, NAME_LENGTH
@@ -2768,15 +3051,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, [wNumInBox]
dec a
- jr z, .asm_e867
+ jr z, .asm_e7ab
ld hl, wBoxMons
ld bc, wBoxMon2 - wBoxMon1
dec a
@@ -2790,7 +3073,7 @@ SendNewMonToBox:
ld a, [wNumInBox]
dec a
ld b, a
-.asm_e854
+.asm_e798
push bc
push hl
ld bc, wBoxMon2 - wBoxMon1
@@ -2802,8 +3085,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
@@ -2833,11 +3116,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
@@ -2846,12 +3129,18 @@ 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, $60 ; twistedspoon in gsc
+ ld [wBoxMon1CatchRate], a
+.notKadabra
ret
; checks if the tile in front of the player is a shore or water tile
@@ -2861,24 +3150,21 @@ 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
+ ld a, [wTileInFrontOfPlayer]
+ ld de, $1
+ call IsInArray
ret
; tilesets with water
@@ -2886,52 +3172,12 @@ WaterTilesets:
db OVERWORLD, FOREST, DOJO, GYM, SHIP, SHIP_PORT, CAVERN, FACILITY, PLATEAU
db $ff ; terminator
-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
- 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/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/tms.asm b/engine/items/tms.asm
index da1b5e72..84770747 100755
--- a/engine/items/tms.asm
+++ b/engine/items/tms.asm
@@ -11,6 +11,8 @@ CanLearnTM:
ld hl, TechnicalMachines
.findTMloop
ld a, [hli]
+ cp $ff ; 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/joypad.asm b/engine/joypad.asm
index 31e197e2..4126568c 100644
--- a/engine/joypad.asm
+++ b/engine/joypad.asm
@@ -1,12 +1,48 @@
+ReadJoypad_::
+; Poll joypad input.
+; Unlike the hardware register, button
+; presses are indicated by a set bit.
+ ld a, [hDisableJoypadPolling]
+ and a
+ ret nz
+
+ ld a, 1 << 5 ; select direction keys
+ ;ld c, 0
+
+ ld [rJOYP], a
+ ld a, [rJOYP]
+ ld a, [rJOYP]
+ cpl
+ and %1111
+ swap a
+ ld b, a
+
+ ld a, 1 << 4 ; select button keys
+ ld [rJOYP], a
+ rept 6
+ ld a, [rJOYP]
+ endr
+ cpl
+ and %1111
+ or b
+
+ ld [hJoyInput], a
+
+ ld a, 1 << 4 + 1 << 5 ; deselect keys
+ ld [rJOYP], a
+ ret
+
+
_Joypad::
; hJoyReleased: (hJoyLast ^ hJoyInput) & hJoyLast
; hJoyPressed: (hJoyLast ^ hJoyInput) & hJoyInput
ld a, [hJoyInput]
+ ld b,a
+ and $4F
cp A_BUTTON + B_BUTTON + SELECT + START ; soft reset
jp z, TrySoftReset
- ld b, a
ld a, [hJoyLast]
ld e, a
xor b
diff --git a/engine/learn_move.asm b/engine/learn_move.asm
index 53c7f87e..021d0eeb 100755
--- a/engine/learn_move.asm
+++ b/engine/learn_move.asm
@@ -121,18 +121,17 @@ TryingToLearn:
ld hl, WhichMoveToForgetText
call PrintText
coord hl, 4, 7
- ld b, 4
- ld c, 14
+ lb bc, 4, 14
call TextBoxBorder
coord hl, 6, 8
ld de, wMovesString
- ld a, [hFlags_0xFFF6]
+ ld a, [hFlags_0xFFFA]
set 2, a
- ld [hFlags_0xFFF6], a
+ ld [hFlags_0xFFFA], a
call PlaceString
- ld a, [hFlags_0xFFF6]
+ ld a, [hFlags_0xFFFA]
res 2, a
- ld [hFlags_0xFFF6], a
+ ld [hFlags_0xFFFA], a
ld hl, wTopMenuItemY
ld a, 8
ld [hli], a ; wTopMenuItemY
@@ -146,10 +145,10 @@ TryingToLearn:
ld a, A_BUTTON | B_BUTTON
ld [hli], a ; wMenuWatchedKeys
ld [hl], 0 ; wLastMenuItem
- ld hl, hFlags_0xFFF6
+ ld hl, hFlags_0xFFFA
set 1, [hl]
call HandleMenuInput
- ld hl, hFlags_0xFFF6
+ ld hl, hFlags_0xFFFA
res 1, [hl]
push af
call LoadScreenTilesFromBuffer1
@@ -206,11 +205,36 @@ TryingToLearnText:
db "@"
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
TX_FAR _OneTwoAndText
TX_DELAY
TX_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/load_mon_data.asm b/engine/load_mon_data.asm
index a71a81c5..e708113f 100644
--- a/engine/load_mon_data.asm
+++ b/engine/load_mon_data.asm
@@ -15,7 +15,7 @@ LoadMonData_:
ld a, [wWhichPokemon]
ld e, a
- callab 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, wEnemyPartyMons
+.getSpecies
+ ld d, 0
+ add hl, de
+ ld a, [hl]
+ ld [wcf91], a
+ ret
diff --git a/engine/menu/bills_pc.asm b/engine/menu/bills_pc.asm
index 0864828a..41626310 100644
--- a/engine/menu/bills_pc.asm
+++ b/engine/menu/bills_pc.asm
@@ -11,18 +11,15 @@ DisplayPCMainMenu::
and a
jr nz, .leaguePCAvailable
coord hl, 0, 0
- ld b, 8
- ld c, 14
+ lb bc, 8, 14
jr .next
.noOaksPC
coord hl, 0, 0
- ld b, 6
- ld c, 14
+ lb bc, 6, 14
jr .next
.leaguePCAvailable
coord hl, 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), $01
call CopyVideoData
call LoadScreenTilesFromBuffer2DisableBGTransfer
+ coord hl, 0, 12
+ lb bc, 4, 18
+ call TextBoxBorder
coord hl, 0, 0
- ld b, 10
- ld c, 12
+ lb bc, 12, 12
call TextBoxBorder
+ call UpdateSprites
coord hl, 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
coord hl, 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:
+ callab PrintPCBox
+ jp BillsPCMenu
+
BillsPCDeposit:
ld a, [wPartyCount]
dec a
@@ -222,11 +225,26 @@ BillsPCDeposit:
ld hl, wPartyCount
call DisplayMonListMenu
jp c, BillsPCMenu
+ callab 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
+ callab IsThisPartymonStarterPikachu_Party
+ jr nc, .asm_215c9
+ ld e, $1b
+ callab 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:
+ TX_FAR _SleepingPikachuText2
+ db "@"
+
BillsPCWithdraw:
ld a, [wNumInBox]
and a
@@ -276,9 +298,15 @@ BillsPCWithdraw:
ld a, [wWhichPokemon]
ld hl, wBoxMonNicks
call GetPartyMonName
+ callab IsThisPartymonStarterPikachu_Box
+ jr nc, .asm_21660
+ ld e, $22
+ callab 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, wNumInBox
call DisplayMonListMenu
jp c, BillsPCMenu
+ callab 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
+ callab PlayPikachuSoundClip
+ ld hl, PikachuUnhappyText
+ call PrintText
+ jp BillsPCMenu
+
BillsPCChangeBox:
callba ChangeBox
jp BillsPCMenu
@@ -343,6 +383,7 @@ BillsPCMenuText:
next "DEPOSIT ", $4a
next "RELEASE ", $4a
next "CHANGE BOX"
+ next "PRINT BOX"
next "SEE YA!"
db "@"
@@ -386,8 +427,7 @@ HMMoveArray:
DisplayDepositWithdrawMenu:
coord hl, 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?
@@ -493,6 +533,10 @@ CantTakeMonText:
TX_FAR _CantTakeMonText
db "@"
+PikachuUnhappyText:
+ TX_FAR _PikachuUnhappyText
+ db "@"
+
ReleaseWhichMonText:
TX_FAR _ReleaseWhichMonText
db "@"
@@ -509,7 +553,7 @@ CableClubLeftGameboy::
ld a, [hSerialConnectionStatus]
cp USING_EXTERNAL_CLOCK
ret z
- ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction
+ ld a, [wSpritePlayerStateData1FacingDirection] ; player's sprite facing direction
cp SPRITE_FACING_RIGHT
ret nz
ld a, [wCurMap]
@@ -526,7 +570,7 @@ CableClubRightGameboy::
ld a, [hSerialConnectionStatus]
cp USING_INTERNAL_CLOCK
ret z
- ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction
+ ld a, [wSpritePlayerStateData1FacingDirection] ; player's sprite facing direction
cp SPRITE_FACING_LEFT
ret nz
ld a, [wCurMap]
@@ -543,12 +587,12 @@ JustAMomentText::
TX_FAR _JustAMomentText
db "@"
- ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction
+ ld a, [wSpritePlayerStateData1FacingDirection] ; player's sprite facing direction
cp SPRITE_FACING_UP
ret nz
call EnableAutoTextBoxDrawing
tx_pre_jump OpenBillsPCText
OpenBillsPCText::
- db $FD ; FuncTX_BillsPC
+ TX_BILLS_PC
diff --git a/engine/menu/diploma.asm b/engine/menu/diploma.asm
index 09ba123e..3f309bd2 100755..100644
--- a/engine/menu/diploma.asm
+++ b/engine/menu/diploma.asm
@@ -6,108 +6,12 @@ DisplayDiploma:
ld [wUpdateSpritesEnabled], a
ld hl, wd730
set 6, [hl]
- call DisableLCD
- ld hl, CircleTile
- ld de, vChars2 + $700
- ld bc, $0010
- ld a, BANK(CircleTile)
- call FarCopyData2
- coord hl, 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
- coord hl, 10, 4
- ld de, wPlayerName
- call PlaceString
- callba 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
- callba LoadTrainerInfoTextBoxTiles
- ld b, SET_PAL_GENERIC
- call RunPaletteCommand
- call Delay3
- call GBPalNormal
- ld a, $90
- ld [rOBP0], a
+ callab _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
- ld bc, $ff00
-.loop
- ld a, [hli]
- cp "@"
- ret z
- dec c
- jr .loop
-
-DiplomaTextPointersAndCoords:
- dw DiplomaText
- dwCoord 5, 2
- dw DiplomaPlayer
- dwCoord 3, 4
- dw DiplomaEmptyText
- dwCoord 15, 4
- dw DiplomaCongrats
- dwCoord 2, 6
- dw DiplomaGameFreak
- dwCoord 9, 16
-
-DiplomaText:
- db $70,"Diploma",$70,"@"
-
-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/menu/draw_start_menu.asm b/engine/menu/draw_start_menu.asm
index 11777dc6..632b8c3a 100644
--- a/engine/menu/draw_start_menu.asm
+++ b/engine/menu/draw_start_menu.asm
@@ -3,13 +3,11 @@ DrawStartMenu:
CheckEvent EVENT_GOT_POKEDEX
; menu with pokedex
coord hl, 10, 0
- ld b, $0e
- ld c, $08
- jr nz, .drawTextBoxBorder
+ lb bc, 14, 8
+ jr nz,.drawTextBoxBorder
; shorter menu if the player doesn't have the pokedex
coord hl, 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/menu/league_pc.asm b/engine/menu/league_pc.asm
index 170c0ef3..9946b90d 100755
--- a/engine/menu/league_pc.asm
+++ b/engine/menu/league_pc.asm
@@ -100,8 +100,7 @@ LeaguePCShowMon:
call LoadFrontSpriteByMonIndex
call GBPalNormal
coord hl, 0, 13
- ld b, 2
- ld c, $12
+ lb bc, 2, 18
call TextBoxBorder
coord hl, 1, 15
ld de, HallOfFameNoText
@@ -110,7 +109,7 @@ LeaguePCShowMon:
ld de, wHoFTeamNo
lb bc, 1, 3
call PrintNumber
- jpba HoFDisplayMonInfo
+ jpba Func_7033f
HallOfFameNoText:
db "HALL OF FAME No @"
diff --git a/engine/menu/link_menu.asm b/engine/menu/link_menu.asm
new file mode 100644
index 00000000..9bc28b31
--- /dev/null
+++ b/engine/menu/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]
+ ld [hSerialSendData],a
+ call Serial_ExchangeByte
+ push af
+ ld hl,wLinkMenuSelectionSendBuffer
+ ld a,[hl]
+ ld [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
+ ld 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]
+ ld [hSerialSendData],a
+ call Serial_ExchangeByte
+ call Serial_ExchangeByte
+ ld b,$14
+.loop
+ call DelayFrame
+ call Serial_SendZeroByte
+ dec b
+ jr nz,.loop
+ ld b,$7f
+ ld c,$7f
+ ld d,$7f
+ ld e,$ec
+ 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
+ Coorda 9,2
+ ld a,c
+ Coorda 9,4
+ ld a,d
+ Coorda 9,6
+ ld a,e
+ Coorda 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
+ callab Func_3b10f
+ pop hl
+ jp c,asm_f56ad
+ inc hl
+ ld a,[hl]
+ ld [wcf91],a
+ push hl
+ callab Func_3b10f
+ pop hl
+ jp c,asm_f56ad
+ inc hl
+ ld a,[hl]
+ ld [wcf91],a
+ push hl
+ callab 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
+ ld [H_AUTOBGTRANSFERENABLED],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
+ ld [H_AUTOBGTRANSFERENABLED],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::
+ TX_FAR _Colosseum3MonsText
+ db "@"
+
+ColosseumMewText::
+ TX_FAR _ColosseumMewText
+ db "@"
+
+ColosseumDifferentMonsText::
+ TX_FAR _ColosseumDifferentMonsText
+ db "@"
+
+ColosseumMaxL55Text::
+ TX_FAR _ColosseumMaxL55Text
+ db "@"
+
+ColosseumMinL50Text::
+ TX_FAR _ColosseumMinL50Text
+ db "@"
+
+ColosseumTotalL155Text::
+ TX_FAR _ColosseumTotalL155Text
+ db "@"
+
+ColosseumMaxL30Text::
+ TX_FAR _ColosseumMaxL30Text
+ db "@"
+
+ColosseumMinL25Text::
+ TX_FAR _ColosseumMinL25Text
+ db "@"
+
+ColosseumTotalL80Text::
+ TX_FAR _ColosseumTotalL80Text
+ db "@"
+
+ColosseumMaxL20Text::
+ TX_FAR _ColosseumMaxL20Text
+ db "@"
+
+ColosseumMinL15Text::
+ TX_FAR _ColosseumMinL15Text
+ db "@"
+
+ColosseumTotalL50Text::
+ TX_FAR _ColosseumTotalL50Text
+ db "@"
+
+ColosseumHeightText::
+ TX_FAR _ColosseumHeightText
+ db "@"
+
+ColosseumWeightText::
+ TX_FAR _ColosseumWeightText
+ db "@"
+
+ColosseumEvolvedText::
+ TX_FAR _ColosseumEvolvedText
+ db "@"
+
+ColosseumIneligibleText::
+ TX_FAR _ColosseumIneligibleText
+ db "@"
+
+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
+ coord hl, 5, 3
+ lb bc, 8, 13
+ call TextBoxBorder
+ call UpdateSprites
+ coord hl, 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.
+ ld 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
+ ld a, [hSerialConnectionStatus]
+ cp USING_INTERNAL_CLOCK
+ jr nz, .skipStartingTransfer
+ call DelayFrame
+ call DelayFrame
+ ld a, START_TRANSFER_INTERNAL_CLOCK
+ ld [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
+ callab 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
+ jpab SpecialEnterMap
+.choseCancel
+ xor a
+ ld [wMenuJoypadPollCount], a
+ call Delay3
+ callab 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
+ ld 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
+ Coorda 6, 5
+ ld a, c
+ Coorda 6, 7
+ ld a, d
+ Coorda 6, 9
+ ld a, e
+ Coorda 6, 11
+ ld c, 40
+ call DelayFrames
+ ret
+
+ColosseumWhereToText:
+ TX_FAR _ColosseumWhereToText
+ db "@"
+
+ColosseumPleaseWaitText:
+ TX_FAR _ColosseumPleaseWaitText
+ db "@"
+
+ColosseumCanceledText:
+ TX_FAR _ColosseumCanceledText
+ db "@"
+
+ColosseumVersionText:
+ TX_FAR _ColosseumVersionText
+ db "@"
+
+TextTerminator_f5a16:
+ db "@"
+
+TradeCenterText:
+ db "TRADE CENTER"
+ next "COLOSSEUM"
+ next "COLOSSEUM2"
+ next "CANCEL@"
diff --git a/engine/menu/main_menu.asm b/engine/menu/main_menu.asm
index da2e98e4..ce27ebba 100755
--- a/engine/menu/main_menu.asm
+++ b/engine/menu/main_menu.asm
@@ -34,8 +34,7 @@ MainMenu:
jr z, .noSaveFile
; there's a save file
coord hl, 0, 0
- ld b, 6
- ld c, 13
+ lb bc, 6, 13
call TextBoxBorder
coord hl, 2, 2
ld de, ContinueText
@@ -43,8 +42,7 @@ MainMenu:
jr .next2
.noSaveFile
coord hl, 0, 0
- ld b, 4
- ld c, 13
+ lb bc, 4, 13
call TextBoxBorder
coord hl, 2, 2
ld de, NewGameText
@@ -129,185 +127,29 @@ 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, TextTerminator_6b20
- call PrintText
- call SaveScreenTilesToBuffer1
- ld hl, WhereWouldYouLikeText
- call PrintText
- coord hl, 5, 5
- ld b, $6
- ld c, $d
- call TextBoxBorder
- call UpdateSprites
- coord hl, 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.
- ld a, [hSerialConnectionStatus]
- cp USING_INTERNAL_CLOCK
- jr z, .doneChoosingMenuSelection
-.useEnemyMenuSelection
- ld a, b
- ld [wLinkMenuSelectionSendBuffer], a
- and $3
- ld [wCurrentMenuItem], a
-.doneChoosingMenuSelection
- ld a, [hSerialConnectionStatus]
- cp USING_INTERNAL_CLOCK
- jr nz, .skipStartingTransfer
- call DelayFrame
- call DelayFrame
- ld a, START_TRANSFER_INTERNAL_CLOCK
- ld [rSC], a
-.skipStartingTransfer
- ld b, $7f
- ld c, $7f
- ld d, $ec
- 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
- Coorda 6, 7
- ld a, c
- Coorda 6, 9
- ld a, d
- Coorda 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:
- TX_FAR _WhereWouldYouLikeText
- db "@"
-
-PleaseWaitText:
- TX_FAR _PleaseWaitText
- db "@"
-
-LinkCanceledText:
- TX_FAR _LinkCanceledText
+NotEnoughMemoryText:
+ TX_FAR _NotEnoughMemoryText
db "@"
StartNewGame:
ld hl, wd732
res 1, [hl]
call OakSpeech
+ ld a, $8
+ ld [wPlayerMovingDirection], a
ld c, 20
call DelayFrames
@@ -323,6 +165,7 @@ SpecialEnterMap:
call ResetPlayerSpriteData
ld c, 20
call DelayFrames
+ call Func_5cc1
ld a, [wEnteringCableClub]
and a
ret nz
@@ -335,17 +178,11 @@ NewGameText:
db "NEW GAME"
next "OPTION@"
-CableClubOptionsText:
- db "TRADE CENTER"
- next "COLOSSEUM"
- next "CANCEL@"
-
DisplayContinueGameInfo:
xor a
ld [H_AUTOBGTRANSFERENABLED], a
coord hl, 4, 7
- ld b, 8
- ld c, 14
+ lb bc, 8, 14
call TextBoxBorder
coord hl, 5, 9
ld de, SaveScreenInfoText
@@ -368,8 +205,7 @@ PrintSaveScreenText:
xor a
ld [H_AUTOBGTRANSFERENABLED], a
coord hl, 4, 0
- ld b, $8
- ld c, $e
+ lb bc, 8, 14
call TextBoxBorder
call LoadTextBoxTilePatterns
call UpdateSprites
@@ -427,259 +263,8 @@ SaveScreenInfoText:
next "TIME@"
DisplayOptionMenu:
- coord hl, 0, 0
- ld b, 3
- ld c, 18
- call TextBoxBorder
- coord hl, 0, 5
- ld b, 3
- ld c, 18
- call TextBoxBorder
- coord hl, 0, 10
- ld b, 3
- ld c, 18
- call TextBoxBorder
- coord hl, 1, 1
- ld de, TextSpeedOptionText
- call PlaceString
- coord hl, 1, 6
- ld de, BattleAnimationOptionText
- call PlaceString
- coord hl, 1, 11
- ld de, BattleStyleOptionText
- call PlaceString
- coord hl, 2, 16
- ld de, OptionMenuCancelText
- call PlaceString
- xor a
- ld [wCurrentMenuItem], a
- ld [wLastMenuItem], a
- inc a
- ld [wLetterPrintingDelayFlags], a
- ld [wUnusedCD40], 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
- ld [H_AUTOBGTRANSFERENABLED], a ; enable auto background transfer
- call Delay3
-.loop
- call PlaceMenuCursor
- call SetOptionsFromCursorPositions
-.getJoypadStateLoop
- call JoypadLowSensitivity
- ld 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
+ callab 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
- coord hl, 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
- coord hl, 0, 8
- call .placeUnfilledRightArrow
- sla c
- ld a, 1
- jr nc, .storeBattleStyleCursorX
- ld a, 10
-.storeBattleStyleCursorX
- ld [wOptionsBattleStyleCursorX], a ; battle style cursor X coordinate
- coord hl, 0, 13
- call .placeUnfilledRightArrow
-; cursor in front of Cancel
- coord hl, 0, 16
- ld a, 1
-.placeUnfilledRightArrow
- ld e, a
- ld d, 0
- add hl, de
- ld [hl], $ec ; unfilled right arrow menu cursor
- 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 $ff ; terminator
CheckForPlayerNameInSRAM:
; Check if the player name data in SRAM has a string terminator character
diff --git a/engine/menu/naming_screen.asm b/engine/menu/naming_screen.asm
index 64065c4d..2560677a 100755
--- a/engine/menu/naming_screen.asm
+++ b/engine/menu/naming_screen.asm
@@ -5,8 +5,7 @@ AskName:
ld a, [wIsInBattle]
dec a
coord hl, 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
callba LoadMonPartySpriteGfx
coord hl, 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 + $700
- 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
+ ld 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/ED_tile.1bpp"
diff --git a/engine/menu/options.asm b/engine/menu/options.asm
new file mode 100644
index 00000000..da89ad82
--- /dev/null
+++ b/engine/menu/options.asm
@@ -0,0 +1,443 @@
+DisplayOptionMenu_:
+ call InitOptionsMenu
+.optionMenuLoop
+ call JoypadLowSensitivity
+ ld 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
+ ld 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]
+ coord hl, 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:
+ ld 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]
+ coord hl, 14, 4
+ call PlaceString
+ and a
+ ret
+
+AnimationOptionStringsPointerTable:
+ dw AnimationOnText
+ dw AnimationOffText
+
+AnimationOnText:
+ db "ON @"
+AnimationOffText:
+ db "OFF@"
+
+OptionsMenu_BattleStyle:
+ ld 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]
+ coord hl, 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
+ ld 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
+ ld [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]
+ coord hl, 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
+ ld 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]
+ coord hl, 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:
+ ld a, [hJoy5]
+ and A_BUTTON
+ jr nz, .pressedCancel
+ and a
+ ret
+.pressedCancel
+ scf
+ ret
+
+OptionsControl:
+ ld hl, wOptionsCursorLocation
+ ld 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:
+ coord hl, 1, 1
+ ld de, SCREEN_WIDTH
+ ld c, 16
+.loop
+ ld [hl], " "
+ add hl, de
+ dec c
+ jr nz, .loop
+ coord hl, 1, 2
+ ld bc, SCREEN_WIDTH * 2
+ ld a, [wOptionsCursorLocation]
+ call AddNTimes
+ ld [hl], "▶"
+ ret
+
+InitOptionsMenu:
+ coord hl, 0, 0
+ lb bc, SCREEN_HEIGHT - 2, SCREEN_WIDTH - 2
+ call TextBoxBorder
+ coord hl, 2, 2
+ ld de, AllOptionsText
+ call PlaceString
+ coord hl, 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
+ ld [H_AUTOBGTRANSFERENABLED], a
+ call Delay3
+ ret
+
+AllOptionsText:
+ db "TEXT SPEED :"
+ next "ANIMATION :"
+ next "BATTLESTYLE:"
+ next "SOUND:"
+ next "PRINT:@"
+
+OptionMenuCancelText:
+ db "CANCEL@"
diff --git a/engine/menu/party_menu.asm b/engine/menu/party_menu.asm
index 8323d0eb..00c757be 100755
--- a/engine/menu/party_menu.asm
+++ b/engine/menu/party_menu.asm
@@ -49,9 +49,17 @@ RedrawPartyMenu_:
call GetPartyMonName
pop hl
call PlaceString ; print the pokemon's name
- callba WriteMonPartySpriteOAMByPartyIndex ; place the appropriate pokemon icon
ld a, [hPartyMonIndex]
ld [wWhichPokemon], a
+ callab IsThisPartymonStarterPikachu_Party
+ jr nc, .regularMon
+ call CheckPikachuFollowingPlayer
+ jr z, .regularMon
+ ld a, $ff
+ ld [hPartyMonIndex], a
+.regularMon
+ callba WriteMonPartySpriteOAMByPartyIndex ; place the appropriate pokemon icon
+ ld a, [wWhichPokemon]
inc a
ld [hPartyMonIndex], a
call LoadMonData
@@ -88,14 +96,14 @@ RedrawPartyMenu_:
pop hl
push hl
ld bc, SCREEN_WIDTH + 1 ; down 1 row and right 1 column
- ld a, [hFlags_0xFFF6]
+ ld a, [hFlags_0xFFFA]
set 0, a
- ld [hFlags_0xFFF6], a
+ ld [hFlags_0xFFFA], a
add hl, bc
predef DrawHP2 ; draw HP bar and prints current / max HP
- ld a, [hFlags_0xFFF6]
+ ld a, [hFlags_0xFFFA]
res 0, a
- ld [hFlags_0xFFF6], a
+ ld [hFlags_0xFFFA], a
call SetPartyMenuHPBarColor ; color the HP bar (on SGB)
pop hl
jr .printLevel
@@ -109,8 +117,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
@@ -176,9 +184,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/menu/players_pc.asm b/engine/menu/players_pc.asm
index bc2be4ef..1cc02cbf 100755
--- a/engine/menu/players_pc.asm
+++ b/engine/menu/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
coord hl, 0, 0
- ld b, $8
- ld c, $e
+ lb bc, 8, 14
call TextBoxBorder
call UpdateSprites
coord hl, 2, 2
diff --git a/engine/menu/pokedex.asm b/engine/menu/pokedex.asm
index 8e1fd480..bc2a7e9b 100755
--- a/engine/menu/pokedex.asm
+++ b/engine/menu/pokedex.asm
@@ -12,9 +12,10 @@ ShowPokedexMenu:
ld [wd11e], a
ld [hJoy7], a
.setUpGraphics
+ callab LoadPokedexTilePatterns
+.loop
ld b, SET_PAL_GENERIC
call RunPaletteCommand
- callab 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
+ ld [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
+ ld [hJoy7], a
push bc
coord hl, 0, 3
ld de, 20
@@ -128,9 +137,9 @@ HandlePokedexSideMenu:
.buttonBPressed
push bc
- coord hl, 15, 10
+ coord hl, 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
+ ld a, [hTilesetType]
+ push af
+ xor a
+ ld [hTilesetType], a
+ ld a, [wd11e]
+ ld [wcf91], a
+ callab PrintPokedexEntry
+ xor a
+ ld [H_AUTOBGTRANSFERENABLED], a
+ call ClearScreen
+ pop af
+ ld [hTilesetType], 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 a, 7
+ jp c, .loop ; can't if the list is shorter than 7
+ sub a, 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 a, 7
+ jp c, .loop ; can't if the list is shorter than 7
+ sub a, 6
+ ld b, a
+ ld a, [wListScrollOffset]
+ add a, 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 a, 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
ld [H_AUTOBGTRANSFERENABLED], a
; draw the horizontal line separating the seen and owned amounts from the menu
- coord hl, 15, 8
+ coord hl, 15, 6
ld a, "─"
ld [hli], a
ld [hli], a
@@ -175,26 +276,26 @@ HandlePokedexListMenu:
ld b, wPokedexSeenEnd - wPokedexSeen
call CountSetBits
ld de, wNumSetBits
- coord hl, 16, 3
+ coord hl, 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
- coord hl, 16, 6
+ coord hl, 16, 5
lb bc, 1, 3
call PrintNumber ; print number of owned pokemon
- coord hl, 16, 2
+ coord hl, 16, 1
ld de, PokedexSeenText
call PlaceString
- coord hl, 16, 5
+ coord hl, 16, 4
ld de, PokedexOwnText
call PlaceString
coord hl, 1, 1
ld de, PokedexContentsText
call PlaceString
- coord hl, 16, 10
+ coord hl, 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 a, 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
ld [H_AUTOBGTRANSFERENABLED], a
coord hl, 4, 2
@@ -282,98 +413,8 @@ HandlePokedexListMenu:
ld a, 01
ld [H_AUTOBGTRANSFERENABLED], 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
ld [rNR50], a
+ ld a, [hTilesetType]
+ push af
+ xor a
+ ld [hTilesetType], a
call GBPalWhiteOut ; zero all palettes
- call ClearScreen
ld a, [wd11e] ; pokemon ID
ld [wcf91], a
push af
@@ -410,10 +454,44 @@ ShowPokedexDataInternal:
call RunPaletteCommand
pop af
ld [wd11e], a
- ld a, [hTilesetType]
- push af
- xor a
+ call DrawDexEntryOnScreen
+ call c, Pokedex_PrintFlavorTextAtRow11
+.waitForButtonPress
+ call JoypadLowSensitivity
+ ld a, [hJoy5]
+ and a, A_BUTTON | B_BUTTON
+ jr z, .waitForButtonPress
+ pop af
ld [hTilesetType], a
+ call GBPalWhiteOut
+ call ClearScreen
+ call RunDefaultPaletteCommand
+ call LoadTextBoxTilePatterns
+ call GBPalNormal
+ ld hl, wd72c
+ res 1, [hl]
+ ld a, $77 ; max volume
+ ld [rNR50], a
+ ret
+
+HeightWeightText:
+ db "HT ?", $60, "??", $61
+ 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
+ db $69, $6B, $69, $6B, $6B
+ db $6B, $6B, $69, $6B, $69
+ db $6B, $69, $6B, $69, $6A
+ db "@"
+
+DrawDexEntryOnScreen:
+ call ClearScreen
coord hl, 0, 0
ld de, 1
@@ -512,7 +590,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
coord hl, 12, 6
@@ -565,45 +644,48 @@ ShowPokedexDataInternal:
ld [hDexWeight], a ; restore original value of [hDexWeight]
pop hl
inc hl ; hl = address of pokedex description text
+ scf
+ ret
+
+Pokedex_PrintFlavorTextAtRow11:
coord bc, 1, 11
+Pokedex_PrintFlavorTextAtBC:
ld a, 2
- ld [$fff4], a
+ ld [$fff9], a
call TextCommandProcessor ; print pokedex description text
xor a
- ld [$fff4], a
-.waitForButtonPress
- call JoypadLowSensitivity
- ld a, [hJoy5]
- and A_BUTTON | B_BUTTON
- jr z, .waitForButtonPress
- pop af
- ld [hTilesetType], a
- call GBPalWhiteOut
- call ClearScreen
- call RunDefaultPaletteCommand
- call LoadTextBoxTilePatterns
- call GBPalNormal
- ld hl, wd72c
- res 1, [hl]
- ld a, $77 ; max volume
- ld [rNR50], a
+ ld [$fff9], a
ret
-HeightWeightText:
- db "HT ?",$60,"??",$61
- 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
- db $69,$6B,$69,$6B,$6B
- db $6B,$6B,$69,$6B,$69
- db $6B,$69,$6B,$69,$6A
- db "@"
+Pokedex_PrepareDexEntryForPrinting:
+ coord hl, 0, 0
+ ld de, SCREEN_WIDTH
+ lb bc, $66, $d
+ call DrawTileLine
+ coord hl, 19, 0
+ ld b, $67
+ call DrawTileLine
+ coord hl, 0, 13
+ ld de, $1
+ lb bc, $6f, SCREEN_WIDTH
+ call DrawTileLine
+ ld a, $6c
+ Coorda 0, 13
+ ld a, $6e
+ Coorda 19, 13
+ ld a, [wPrinterPokedexEntryTextPointer]
+ ld l, a
+ ld a, [wPrinterPokedexEntryTextPointer + 1]
+ ld h, a
+ coord bc, 1, 1
+ ld a, [hFlags_0xFFFA]
+ set 3, a
+ ld [hFlags_0xFFFA], a
+ call Pokedex_PrintFlavorTextAtBC
+ ld a, [hFlags_0xFFFA]
+ res 3, a
+ ld [hFlags_0xFFFA], a
+ ret
; draws a line of tiles
; INPUT:
diff --git a/engine/menu/prize_menu.asm b/engine/menu/prize_menu.asm
index bcd0d4ea..405441c8 100755
--- a/engine/menu/prize_menu.asm
+++ b/engine/menu/prize_menu.asm
@@ -23,8 +23,7 @@ CeladonPrizeMenu:
ld [wTopMenuItemX], a
call PrintPrizePrice
coord hl, 0, 2
- ld b, 8
- ld c, 16
+ lb bc, 8, 16
call TextBoxBorder
call GetPrizeMenuId
call UpdateSprites
@@ -145,12 +144,14 @@ GetPrizeMenuId:
ld c, (1 << 7 | 2)
jp PrintBCDNumber
+NoThanksText:
+ db "NO THANKS@"
+
INCLUDE "data/prizes.asm"
PrintPrizePrice:
coord hl, 11, 0
- ld b, 1
- ld c, 7
+ lb bc, 1, 7
call TextBoxBorder
call UpdateSprites
coord hl, 12, 0
diff --git a/engine/menu/start_menu.asm b/engine/menu/start_menu.asm
index eb4b4f2d..498d1467 100755
--- a/engine/menu/start_menu.asm
+++ b/engine/menu/start_menu.asm
@@ -1,7 +1,5 @@
DisplayStartMenu::
- ld a, BANK(StartMenu_Pokedex)
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
+ switchbank StartMenu_Pokedex ; also bank for other functions
ld a, [wWalkBikeSurfState] ; walking/biking/surfing
ld [wWalkBikeSurfStateCopy], a
ld a, SFX_START_MENU
@@ -9,6 +7,7 @@ DisplayStartMenu::
RedisplayStartMenu::
callba DrawStartMenu
+RedisplayStartMenu_DoNotDrawStartMenu:
callba PrintSafariZoneSteps ; print Safari Zone info, if in Safari Zone
call UpdateSprites
.loop
diff --git a/engine/menu/start_sub_menus.asm b/engine/menu/start_sub_menus.asm
index 947837e3..abc8f000 100755
--- a/engine/menu/start_sub_menus.asm
+++ b/engine/menu/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 1, a ; does the player have the Cascade Badge?
jp z, .newBadgeRequired
@@ -165,15 +168,28 @@ StartMenu_Pokemon:
bit 1, [hl]
res 1, [hl]
jp z, .loop
- ld a, SURFBOARD
+ ld a, [wcf91]
+ cp PIKACHU ; is this surfing 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 3, a ; does the player have the Rainbow Badge?
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,10 @@ StartMenu_Item:
call PrintText
jr .exitMenu
.notInCableClubRoom
- ld bc, wNumBagItems
ld hl, wListPointer
- ld a, c
- ld [hli], a
- ld [hl], b ; store item bag pointer in wListPointer (for DisplayListMenuID)
+ ld [hl], wNumBagItems & $ff
+ inc hl
+ ld [hl], wNumBagItems / $100 ; store item bag pointer in wListPointer (for DisplayListMenuID)
xor a
ld [wPrintItemPrices], a
ld a, ITEMLISTMENU
@@ -515,10 +531,11 @@ StartMenu_TrainerInfo:
call LoadScreenTilesFromBuffer2 ; restore saved screen
call RunDefaultPaletteCommand
call ReloadMapData
+ callba DrawStartMenu ; XXX what difference does this make?
call LoadGBPal
pop af
ld [hTilesetType], a
- jp RedisplayStartMenu
+ jp RedisplayStartMenu_DoNotDrawStartMenu
; loads tile patterns and draws everything except for gym leader faces / badges
DrawTrainerInfo:
@@ -552,7 +569,7 @@ DrawTrainerInfo:
ld de, vChars2 + $200
ld bc, $0400
ld a, $03
- call FarCopyData2
+ call FarCopyData
ld hl, TextBoxGraphics
ld de, $00d0
add hl, de ; hl = colon tile pattern
@@ -560,7 +577,7 @@ DrawTrainerInfo:
ld bc, $0010
ld a, $04
push bc
- call FarCopyData2
+ call FarCopyData
pop bc
ld hl, TrainerInfoTextBoxTileGraphics + $80 ; background tile pattern
ld de, vChars1 + $570
@@ -612,7 +629,7 @@ DrawTrainerInfo:
TrainerInfo_FarCopyData:
ld a, BANK(TrainerInfoTextBoxTileGraphics)
- jp FarCopyData2
+ jp FarCopyData
TrainerInfo_NameMoneyTimeText:
db "NAME/"
diff --git a/engine/menu/status_screen.asm b/engine/menu/status_screen.asm
index ef94f13c..1e2ba889 100755
--- a/engine/menu/status_screen.asm
+++ b/engine/menu/status_screen.asm
@@ -40,7 +40,7 @@ DrawHP_:
push hl
call DrawHPBar
pop hl
- ld a, [hFlags_0xFFF6]
+ ld a, [hFlags_0xFFFA]
bit 0, a
jr z, .printFractionBelowBar
ld bc, $9 ; right of bar
@@ -170,8 +170,25 @@ StatusScreen:
call GBPalNormal
coord hl, 1, 0
call LoadFlippedFrontSpriteByMonIndex ; draw Pokémon picture
+ ld a, [wMonDataLocation]
+ cp ENEMY_PARTY_DATA
+ jr z, .playRegularCry
+ cp BOX_DATA
+ jr z, .checkBoxData
+ callab IsThisPartymonStarterPikachu_Party
+ jr nc, .playRegularCry
+ jr .playPikachuSoundClip
+.checkBoxData
+ callab IsThisPartymonStarterPikachu_Box
+ jr nc, .playRegularCry
+.playPikachuSoundClip
+ ld e, 16
+ callab PlayPikachuSoundClip
+ jr .continue
+.playRegularCry
ld a, [wcf91]
call PlayCry ; play Pokémon cry
+.continue
call WaitForTextScrollButtonPress ; wait for button
pop af
ld [hTilesetType], a
@@ -250,16 +267,14 @@ PrintStatsBox:
and a ; a is 0 from the status screen
jr nz, .DifferentBox
coord hl, 0, 8
- ld b, 8
- ld c, 8
+ lb bc, 8, 8
call TextBoxBorder ; Draws the box
coord hl, 1, 9 ; Start printing stats from here
ld bc, $0019 ; Number offset
jr .PrintStats
.DifferentBox
coord hl, 9, 2
- ld b, 8
- ld c, 9
+ lb bc, 8, 9
call TextBoxBorder
coord hl, 11, 3
ld bc, $0018
@@ -314,8 +329,7 @@ StatusScreen2:
coord hl, 19, 3
ld [hl], $78
coord hl, 0, 8
- ld b, 8
- ld c, 18
+ lb bc, 8, 18
call TextBoxBorder ; Draw move container
coord hl, 2, 9
ld de, wMovesString
diff --git a/engine/menu/text_box.asm b/engine/menu/text_box.asm
index b9a36652..a109bff2 100644
--- a/engine/menu/text_box.asm
+++ b/engine/menu/text_box.asm
@@ -273,8 +273,7 @@ DisplayMoneyBox:
ld [wTextBoxID], a
call DisplayTextBoxID
coord hl, 13, 1
- ld b, 1
- ld c, 6
+ lb bc, 1, 6
call ClearScreenArea
coord hl, 12, 1
ld de, wPlayerMoney
@@ -416,36 +415,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?
@@ -577,8 +550,7 @@ DisplayFieldMoveMonMenu:
; no field moves
coord hl, 11, 11
- ld b, 5
- ld c, 7
+ lb bc, 5, 7
call TextBoxBorder
call UpdateSprites
ld a, 12
diff --git a/engine/menu/vending_machine.asm b/engine/menu/vending_machine.asm
index aab4adf4..37d9b9e7 100755
--- a/engine/menu/vending_machine.asm
+++ b/engine/menu/vending_machine.asm
@@ -18,8 +18,7 @@ VendingMachineMenu:
ld hl, wd730
set 6, [hl]
coord hl, 0, 3
- ld b, 8
- ld c, 12
+ lb bc, 8, 12
call TextBoxBorder
call UpdateSprites
coord hl, 2, 5
diff --git a/engine/mon_party_sprites.asm b/engine/mon_party_sprites.asm
index 864ac136..6f17f876 100755
--- a/engine/mon_party_sprites.asm
+++ b/engine/mon_party_sprites.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
@@ -228,6 +228,11 @@ MonPartySpritePointers:
db BANK(MonPartySprites)
dw vSprites + $260
+ dw PikachuSprite
+ db $40 / $10 ; $40 bytes
+ db BANK(PikachuSprite)
+ dw vSprites + $280
+
dw MonPartySprites + $100
db $40 / $10 ; $40 bytes
db BANK(MonPartySprites)
@@ -298,6 +303,11 @@ MonPartySpritePointers:
db BANK(MonPartySprites)
dw vSprites + $660
+ dw PikachuSprite + $C0
+ db $40 / $10 ; $40 bytes
+ db BANK(PikachuSprite)
+ dw vSprites + $680
+
dw MonPartySprites + $140
db $40 / $10 ; $40 bytes
db BANK(MonPartySprites)
@@ -309,6 +319,8 @@ WriteMonPartySpriteOAMByPartyIndex:
push de
push bc
ld a, [hPartyMonIndex]
+ cp $ff
+ jr z, .asm_7191f
ld hl, wPartySpecies
ld e, a
ld d, 0
@@ -322,6 +334,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].
@@ -343,7 +365,7 @@ UnusedPartyMonSpriteFunction:
ld hl, vSprites
call .LoadTilePatterns
pop af
- add $54
+ add $5A
ld hl, vSprites + $40
call .LoadTilePatterns
xor a
diff --git a/engine/multiply_divide.asm b/engine/multiply_divide.asm
index 52e86b36..d664c9d4 100755
--- a/engine/multiply_divide.asm
+++ b/engine/multiply_divide.asm
@@ -7,11 +7,12 @@ _Multiply:
ld [H_MULTIPLYBUFFER+1], a
ld [H_MULTIPLYBUFFER+2], a
ld [H_MULTIPLYBUFFER+3], a
-.loop
+.multiplyLoop
ld a, [H_MULTIPLIER]
srl a
- ld [H_MULTIPLIER], a ; (aliases: H_DIVISOR, H_MULTIPLIER, H_POWEROFTEN)
- jr nc, .smallMultiplier
+ ld [H_MULTIPLIER], a
+ jr nc, .smallMultiplier ; less than $80
+; code to possibly multiply the multiplicand by 2 and divide the multiplier by 2?
ld a, [H_MULTIPLYBUFFER+3]
ld c, a
ld a, [H_MULTIPLICAND+2]
@@ -24,12 +25,12 @@ _Multiply:
ld [H_MULTIPLYBUFFER+2], a
ld a, [H_MULTIPLYBUFFER+1]
ld c, a
- ld a, [H_MULTIPLICAND] ; (aliases: H_MULTIPLICAND)
+ ld a, [H_MULTIPLICAND]
adc c
ld [H_MULTIPLYBUFFER+1], a
ld a, [H_MULTIPLYBUFFER]
ld c, a
- ld a, [H_PRODUCT] ; (aliases: H_PRODUCT, H_PASTLEADINGZEROES, H_QUOTIENT)
+ ld a, [H_PRODUCT]
adc c
ld [H_MULTIPLYBUFFER], a
.smallMultiplier
@@ -47,7 +48,7 @@ _Multiply:
ld a, [H_PRODUCT]
rl a
ld [H_PRODUCT], a
- jr .loop
+ jr .multiplyLoop
.done
ld a, [H_MULTIPLYBUFFER+3]
ld [H_PRODUCT+3], a
@@ -68,28 +69,28 @@ _Divide:
ld [H_DIVIDEBUFFER+4], a
ld a, $9
ld e, a
-.asm_37db3
+.asm_f6680
ld a, [H_DIVIDEBUFFER]
ld c, a
- ld a, [H_DIVIDEND+1] ; (aliases: H_MULTIPLICAND)
+ ld a, [H_DIVIDEND+1]
sub c
ld d, a
- ld a, [H_DIVISOR] ; (aliases: H_DIVISOR, H_MULTIPLIER, H_POWEROFTEN)
+ ld a, [H_DIVISOR]
ld c, a
- ld a, [H_DIVIDEND] ; (aliases: H_PRODUCT, H_PASTLEADINGZEROES, H_QUOTIENT)
+ ld a, [H_DIVIDEND]
sbc c
- jr c, .asm_37dce
- ld [H_DIVIDEND], a ; (aliases: H_PRODUCT, H_PASTLEADINGZEROES, H_QUOTIENT)
+ jr c, .asm_f669b
+ ld [H_DIVIDEND], a
ld a, d
- ld [H_DIVIDEND+1], a ; (aliases: H_MULTIPLICAND)
+ ld [H_DIVIDEND+1], a
ld a, [H_DIVIDEBUFFER+4]
inc a
ld [H_DIVIDEBUFFER+4], a
- jr .asm_37db3
-.asm_37dce
+ jr .asm_f6680
+.asm_f669b
ld a, b
cp $1
- jr z, .asm_37e18
+ jr z, .done
ld a, [H_DIVIDEBUFFER+4]
sla a
ld [H_DIVIDEBUFFER+4], a
@@ -103,41 +104,41 @@ _Divide:
rl a
ld [H_DIVIDEBUFFER+1], a
dec e
- jr nz, .asm_37e04
+ jr nz, .asm_f66d1
ld a, $8
ld e, a
ld a, [H_DIVIDEBUFFER]
- ld [H_DIVISOR], a ; (aliases: H_DIVISOR, H_MULTIPLIER, H_POWEROFTEN)
+ ld [H_DIVISOR], a
xor a
ld [H_DIVIDEBUFFER], a
- ld a, [H_DIVIDEND+1] ; (aliases: H_MULTIPLICAND)
- ld [H_DIVIDEND], a ; (aliases: H_PRODUCT, H_PASTLEADINGZEROES, H_QUOTIENT)
+ ld a, [H_DIVIDEND+1]
+ ld [H_DIVIDEND], a
ld a, [H_DIVIDEND+2]
- ld [H_DIVIDEND+1], a ; (aliases: H_MULTIPLICAND)
+ ld [H_DIVIDEND+1], a
ld a, [H_DIVIDEND+3]
ld [H_DIVIDEND+2], a
-.asm_37e04
+.asm_f66d1
ld a, e
cp $1
- jr nz, .asm_37e0a
+ jr nz, .asm_f66d7
dec b
-.asm_37e0a
- ld a, [H_DIVISOR] ; (aliases: H_DIVISOR, H_MULTIPLIER, H_POWEROFTEN)
+.asm_f66d7
+ ld a, [H_DIVISOR]
srl a
- ld [H_DIVISOR], a ; (aliases: H_DIVISOR, H_MULTIPLIER, H_POWEROFTEN)
+ ld [H_DIVISOR], a
ld a, [H_DIVIDEBUFFER]
rr a
ld [H_DIVIDEBUFFER], a
- jr .asm_37db3
-.asm_37e18
- ld a, [H_DIVIDEND+1] ; (aliases: H_MULTIPLICAND)
- ld [H_REMAINDER], a ; (aliases: H_DIVISOR, H_MULTIPLIER, H_POWEROFTEN)
+ jr .asm_f6680
+.done
+ ld a, [H_DIVIDEND+1]
+ ld [H_REMAINDER], a
ld a, [H_DIVIDEBUFFER+4]
ld [H_QUOTIENT+3], a
ld a, [H_DIVIDEBUFFER+3]
ld [H_QUOTIENT+2], a
ld a, [H_DIVIDEBUFFER+2]
- ld [H_QUOTIENT+1], a ; (aliases: H_MULTIPLICAND)
+ ld [H_QUOTIENT+1], a
ld a, [H_DIVIDEBUFFER+1]
- ld [H_DIVIDEND], a ; (aliases: H_PRODUCT, H_PASTLEADINGZEROES, H_QUOTIENT)
+ ld [H_QUOTIENT], a
ret
diff --git a/engine/oak_speech.asm b/engine/oak_speech.asm
index b1acfb65..8a537579 100755
--- a/engine/oak_speech.asm
+++ b/engine/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, $200
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, $FF
- call PlaySound ; stop music
+ 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, PIKACHU
ld [wd0b5], a
ld [wcf91], a
call GetMonHeader
@@ -109,13 +117,13 @@ OakSpeech:
ld a, SFX_SHRINK
call PlaySound
pop af
- ld [H_LOADEDROMBANK], 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, $FF
- ld [wNewSoundID], a
- call PlaySound ; stop music
+ call StopAllMusic ; stop music
pop af
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
+ call BankswitchCommon
ld c, 20
call DelayFrames
coord hl, 6, 5
- ld b, 7
- ld c, 7
+ lb bc, 7, 7
call ClearScreenArea
call LoadTextBoxTilePatterns
ld a, 1
@@ -151,7 +155,9 @@ OakSpeech:
ld c, 50
call DelayFrames
call GBFadeOutToWhite
- jp ClearScreen
+ call ClearScreen ; rip more tail-end optimizations
+ ret
+
OakSpeechText1:
TX_FAR _OakSpeechText1
db "@"
@@ -176,6 +182,7 @@ FadeInIntroPic:
.next
ld a, [hli]
ld [rBGP], a
+ call UpdateGBCPal_BGP
ld c, 10
call DelayFrames
dec b
@@ -197,6 +204,7 @@ MovePicLeft:
ld a, %11100100
ld [rBGP], a
+ call UpdateGBCPal_BGP
.next
call DelayFrame
ld 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/oak_speech2.asm b/engine/oak_speech2.asm
index 1258c59b..80f1bafc 100755
--- a/engine/oak_speech2.asm
+++ b/engine/oak_speech2.asm
@@ -108,6 +108,7 @@ OakSpeechSlidePicCommon:
.loop
xor a
ld [H_AUTOBGTRANSFERENABLED], a
+ ld [H_AUTOBGTRANSFERPORTION], a
ld 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
coord hl, 0, 0
- ld b, $a
- ld c, $9
+ lb bc, 10, 9
call TextBoxBorder
coord hl, 3, 0
ld de, .namestring
@@ -187,10 +187,9 @@ DisplayIntroNameTextBox:
.namestring
db "NAME@"
-IF DEF(_RED)
DefaultNamesPlayer:
db "NEW NAME"
- next "RED"
+ next "YELLOW"
next "ASH"
next "JACK"
db "@"
@@ -201,23 +200,6 @@ 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
GetDefaultName:
; a = name index
@@ -243,30 +225,17 @@ GetDefaultName:
ld bc, $14
jp CopyData
-IF DEF(_RED)
DefaultNamesPlayerList:
db "NEW NAME@"
- db "RED@"
+ db "YELLOW@"
db "ASH@"
db "JACK@"
+
DefaultNamesRivalList:
db "NEW NAME@"
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
TextTerminator_6b20:
db "@"
diff --git a/engine/overworld/advance_player_sprite.asm b/engine/overworld/advance_player_sprite.asm
new file mode 100644
index 00000000..6b4a0cbb
--- /dev/null
+++ b/engine/overworld/advance_player_sprite.asm
@@ -0,0 +1,241 @@
+_AdvancePlayerSprite::
+ ld a,[wSpriteStateData1 + 3] ; delta Y
+ ld b,a
+ ld a,[wSpriteStateData1 + 5] ; delta X
+ 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 a,$07
+ jp nz,.scrollBackgroundAndSprites
+; if this is the first iteration of the animation
+ ld a,c
+ cp a,$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 a,$ff
+ jr nz,.checkIfMovingSouth
+; moving west
+ ld a,[wMapViewVRAMPointer]
+ ld e,a
+ and a,$e0
+ ld d,a
+ ld a,e
+ sub $02
+ and $1f
+ or d
+ ld [wMapViewVRAMPointer],a
+ jr .adjustXCoordWithinBlock
+.checkIfMovingSouth
+ ld a,b
+ cp a,$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 a,$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 a,$ff
+ jr nz,.adjustYCoordWithinBlock
+; moved into the tile block to the west
+ ld a,$1
+ 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 $2
+ 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 a,$ff
+ jr nz,.updateMapView
+; moved into the tile block to the north
+ ld a,$1
+ ld [hl],a
+ ld hl,wYOffsetSinceLastSpecialWarp
+ dec [hl]
+ ld de,wCurrentTileBlockMapViewPointer
+ ld a,[wCurMapWidth]
+ call MoveTileBlockMapPointerNorth
+.updateMapView
+ call LoadCurrentMapView
+ ld a,[wSpriteStateData1 + 3] ; delta Y
+ cp $1
+ 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,[wSpriteStateData1 + 5] ; delta X
+ cp $1
+ jr nz,.checkIfMovingWest2
+; if moving east
+ call ScheduleEastColumnRedraw
+ jr .scrollBackgroundAndSprites
+.checkIfMovingWest2
+ cp $ff
+ jr nz,.scrollBackgroundAndSprites
+; if moving west
+ call ScheduleWestColumnRedraw
+.scrollBackgroundAndSprites
+ ld a,[wSpriteStateData1 + 3] ; delta Y
+ add a
+ ld b,a
+ ld a,[wSpriteStateData1 + 5] ; delta X
+ 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,wSpriteStateData1 + $14
+ 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
+ ld a,[hSCY]
+ add b
+ ld [hSCY],a ; update background scroll Y
+ ld a,[hSCX]
+ add c
+ ld [hSCX],a ; update background scroll X
+ ret
+
+MoveTileBlockMapPointerEast::
+ ld a,[de]
+ add $1
+ ld [de],a
+ ret nc
+ inc de
+ ld a,[de]
+ inc a
+ ld [de],a
+ ret
+
+MoveTileBlockMapPointerWest::
+ ld a,[de]
+ sub $1
+ ld [de],a
+ ret nc
+ inc de
+ ld a,[de]
+ dec a
+ ld [de],a
+ ret
+
+MoveTileBlockMapPointerSouth::
+ add $6
+ 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 $6
+ 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/cable_club_npc.asm b/engine/overworld/cable_club_npc.asm
index 08067412..12ce64a4 100755
--- a/engine/overworld/cable_club_npc.asm
+++ b/engine/overworld/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
- jpab LinkMenu
+ ld a, [wLetterPrintingDelayFlags]
+ push af
+ callab 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:
TX_FAR _CableClubNPCAreaReservedFor2FriendsLinkedByCableText
diff --git a/engine/overworld/card_key.asm b/engine/overworld/card_key.asm
index 35495c82..a4452b4a 100755
--- a/engine/overworld/card_key.asm
+++ b/engine/overworld/card_key.asm
@@ -8,7 +8,8 @@ PrintCardKeyText:
ret z
cp b
jr nz, .silphCoMapListLoop
- predef GetTileAndCoordsInFrontOfPlayer
+; does not check for tile in front of player. This might be buggy
+ ;predef GetTileAndCoordsInFrontOfPlayer
ld a, [wTileInFrontOfPlayer]
cp $18
jr z, .cardKeyDoorInFrontOfPlayer
@@ -25,12 +26,12 @@ PrintCardKeyText:
ld b, CARD_KEY
call IsItemInBag
jr z, .noCardKey
- call GetCoordsInFrontOfPlayer
- push de
+ xor a
+ ld [wPlayerMovingDirection], a
tx_pre_id CardKeySuccessText
ld [hSpriteIndexOrTextID], a
call PrintPredefTextID
- pop de
+ call GetCoordsInFrontOfPlayer
srl d
ld a, d
ld b, a
@@ -88,7 +89,7 @@ GetCoordsInFrontOfPlayer:
ld d, a
ld a, [wXCoord]
ld e, a
- ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction
+ ld a, [wSpritePlayerStateData1FacingDirection] ; player's sprite facing direction
and a
jr nz, .notFacingDown
; facing down
diff --git a/engine/overworld/cut.asm b/engine/overworld/cut.asm
index f6ae6468..bc7d092d 100755
--- a/engine/overworld/cut.asm
+++ b/engine/overworld/cut.asm
@@ -76,6 +76,7 @@ InitCutAnimOAM:
ld [wWhichAnimationOffsets], a
ld a, %11100100
ld [rOBP1], a
+ call UpdateGBCPal_OBP1
ld a, [wCutTile]
cp $52
jr z, .grass
@@ -123,8 +124,8 @@ WriteCutOrBoulderDustAnimationOAMBlock:
jp WriteOAMBlock
CutOrBoulderDustAnimationTilesAndAttributes:
- db $FC,$10,$FD,$10
- db $FE,$10,$FF,$10
+ db $FC,$14,$FD,$14
+ db $FE,$14,$FF,$14
GetCutOrBoulderDustAnimationOffsets:
ld hl, wSpriteStateData1 + 4
@@ -187,7 +188,7 @@ ReplaceTreeTileBlock:
ld h, [hl]
ld l, a
add hl, bc
- ld a, [wSpriteStateData1 + 9] ; player sprite's facing direction
+ ld a, [wSpritePlayerStateData1FacingDirection] ; player sprite's facing direction
and a
jr z, .down
cp SPRITE_FACING_UP
diff --git a/engine/overworld/cut2.asm b/engine/overworld/cut2.asm
index f16fed66..37490f95 100755
--- a/engine/overworld/cut2.asm
+++ b/engine/overworld/cut2.asm
@@ -18,6 +18,7 @@ AnimCut:
ld a, [rOBP1]
xor $64
ld [rOBP1], a
+ call UpdateGBCPal_OBP1
call DelayFrame
pop bc
dec c
@@ -68,6 +69,7 @@ AnimCutGrass_UpdateOAMEntries:
ld a, [rOBP1]
xor $64
ld [rOBP1], a
+ call UpdateGBCPal_OBP1
call DelayFrame
pop bc
dec c
diff --git a/engine/overworld/doors.asm b/engine/overworld/doors.asm
index c39e096d..8bde8600 100755
--- a/engine/overworld/doors.asm
+++ b/engine/overworld/doors.asm
@@ -39,6 +39,7 @@ DoorTileIDPointers:
dbw LAB, LabDoorTileIDs
dbw FACILITY, FacilityDoorTileIDs
dbw PLATEAU, PlateauDoorTileIDs
+ dbw INTERIOR, InteriorDoorTileIDs
db $ff
OverworldDoorTileIDs:
@@ -73,3 +74,6 @@ FacilityDoorTileIDs:
PlateauDoorTileIDs:
db $3b,$1b,$00
+
+InteriorDoorTileIDs:
+ db $04,$15,$00
diff --git a/engine/overworld/dungeon_warps.asm b/engine/overworld/dungeon_warps.asm
new file mode 100644
index 00000000..f47dfb01
--- /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/elevator.asm b/engine/overworld/elevator.asm
index d68e4f81..47ec78f9 100755
--- 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, $ff
- call PlaySound
+ call StopAllMusic
ld a, [hSCY]
ld d, a
ld e, $1
@@ -27,8 +26,7 @@ ShakeElevator:
jr nz, .shakeLoop
ld a, d
ld [hSCY], a
- ld a, $ff
- 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 ac4276bd..3b02fd55 100755
--- 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 + $780
lb bc, BANK(EmotionBubbles), $04
call CopyVideoData
@@ -59,12 +62,9 @@ EmotionBubble:
pop af
ld [wUpdateSpritesEnabled], a
call DelayFrame
- jp UpdateSprites
+ call UpdateSprites
+ ret
-EmotionBubblesPointerTable:
- dw EmotionBubbles
- dw EmotionBubbles + $40
- dw EmotionBubbles + $80
EmotionBubblesOAM:
db $F8,$00,$F9,$00
diff --git a/engine/overworld/field_move_messages.asm b/engine/overworld/field_move_messages.asm
index b1506742..1d111917 100644
--- a/engine/overworld/field_move_messages.asm
+++ b/engine/overworld/field_move_messages.asm
@@ -32,7 +32,7 @@ IsSurfingAllowed:
ret nz
CheckBothEventsSet EVENT_SEAFOAM4_BOULDER1_DOWN_HOLE, EVENT_SEAFOAM4_BOULDER2_DOWN_HOLE
ret z
- ld hl, CoordsData_cdf7
+ ld hl, CoordsData_f5b64
call ArePlayerCoordsInArray
ret nc
ld hl, wd728
@@ -45,7 +45,7 @@ IsSurfingAllowed:
ld hl, CyclingIsFunText
jp PrintText
-CoordsData_cdf7:
+CoordsData_f5b64:
db $0B,$07,$FF
CurrentTooFastText:
diff --git a/engine/overworld/healing_machine.asm b/engine/overworld/healing_machine.asm
index 38a44cfb..e5ba004e 100755
--- a/engine/overworld/healing_machine.asm
+++ b/engine/overworld/healing_machine.asm
@@ -12,14 +12,13 @@ AnimateHealingMachine:
push af
ld a, $e0
ld [rOBP1], a
+ call UpdateGBCPal_OBP1
ld hl, wOAMBuffer + $84
ld de, PokeCenterOAMData
call CopyHealingMachineOAM
ld a, 4
ld [wAudioFadeOutControl], a
- ld a, $ff
- ld [wNewSoundID], a
- call PlaySound
+ call StopAllMusic
.waitLoop
ld a, [wAudioFadeOutControl]
and a ; is fade-out finished?
@@ -35,12 +34,10 @@ AnimateHealingMachine:
dec b
jr nz, .partyLoop
ld a, [wAudioROMBank]
- cp BANK(Audio3_UpdateMusic)
+ cp BANK(AudioEngine3)
ld [wAudioSavedROMBank], a
jr nz, .next
- ld a, $ff
- 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
ld [rOBP1], a
+ call UpdateGBCPal_OBP1
pop hl
pop af
ld [hl], a
@@ -66,13 +64,13 @@ PokeCenterFlashingMonitorAndHealBall:
INCBIN "gfx/pokecenter_ball.2bpp"
PokeCenterOAMData:
- db $24,$34,$7C,$10 ; heal machine monitor
- db $2B,$30,$7D,$10 ; pokeballs 1-6
- db $2B,$38,$7D,$30
- db $30,$30,$7D,$10
- db $30,$38,$7D,$30
- db $35,$30,$7D,$10
- db $35,$38,$7D,$30
+ db $24,$34,$7C,$14 ; heal machine monitor
+ db $2B,$30,$7D,$14 ; pokeballs 1-6
+ db $2B,$38,$7D,$34
+ db $30,$30,$7D,$14
+ db $30,$38,$7D,$34
+ db $35,$30,$7D,$14
+ db $35,$38,$7D,$34
; d = value to xor with palette
FlashSprite8Times:
@@ -81,6 +79,7 @@ FlashSprite8Times:
ld a, [rOBP1]
xor d
ld [rOBP1], a
+ call UpdateGBCPal_OBP1
ld c, 10
call DelayFrames
dec b
diff --git a/engine/overworld/hidden_items.asm b/engine/overworld/hidden_items.asm
index 32783f83..b64411c7 100755
--- a/engine/overworld/hidden_items.asm
+++ b/engine/overworld/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
+ ld [hItemAlreadyFound], a
+ ret
+
INCLUDE "data/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
ld [hUnusedCoinsByte], a
ld [hCoins], a
@@ -79,6 +84,12 @@ HiddenCoins:
cp 40
jr z, .bcd20 ; should be bcd40
jr .bcd100
+
+.doNotPickUpCoins
+ ld a, $ff
+ ld [hItemAlreadyFound], a
+ ret
+
.bcd10
ld a, $10
ld [hCoins + 1], a
diff --git a/engine/overworld/hidden_objects.asm b/engine/overworld/hidden_objects.asm
index dcdf8537..66815b60 100755
--- a/engine/overworld/hidden_objects.asm
+++ b/engine/overworld/hidden_objects.asm
@@ -1,43 +1,17 @@
-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 [$ffee], else stores $ff
+; if a hidden object was found, stores $00 in [hDidntFindAnyHiddenObject], else stores $ff
CheckForHiddenObject:
- ld hl, $ffeb
+ ld hl, hItemAlreadyFound
xor a
ld [hli], a
ld [hli], a
ld [hli], a
ld [hl], a
- 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
@@ -81,13 +55,13 @@ CheckForHiddenObject:
ret
.noMatch
ld a, $ff
- ld [$ffee], a
+ ld [hDidntFindAnyHiddenObject], a
ret
; checks if the coordinates in front of the player's sprite match Y in b and X in c
; [hCoordsInFrontOfPlayerMatch] = $00 if they match, $ff if they don't match
CheckIfCoordsInFrontOfPlayerMatch:
- ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction
+ ld a, [wSpritePlayerStateData1FacingDirection] ; player's sprite facing direction
cp SPRITE_FACING_UP
jr z, .facingUp
cp SPRITE_FACING_LEFT
diff --git a/engine/overworld/ledges.asm b/engine/overworld/ledges.asm
index 342540b2..a44ddf8b 100755
--- a/engine/overworld/ledges.asm
+++ b/engine/overworld/ledges.asm
@@ -6,7 +6,7 @@ HandleLedges:
and a ; OVERWORLD
ret nz
predef GetTileAndCoordsInFrontOfPlayer
- ld a, [wSpriteStateData1 + 9]
+ ld a, [wSpritePlayerStateData1FacingDirection]
ld b, a
aCoord 8, 9
ld c, a
@@ -71,10 +71,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:
@@ -82,5 +85,6 @@ LedgeHoppingShadow:
LedgeHoppingShadowEnd:
LedgeHoppingShadowOAM:
- db $FF,$10,$FF,$20
- db $FF,$40,$FF,$60
+ db $58,$48,$FF,$00
+ db $58,$50,$FF,$20
+LedgeHoppingShadowOAMEnd:
diff --git a/engine/overworld/map_sprite_functions1.asm b/engine/overworld/map_sprite_functions1.asm
index d1a411fa..2ad923fb 100644
--- a/engine/overworld/map_sprite_functions1.asm
+++ b/engine/overworld/map_sprite_functions1.asm
@@ -1,7 +1,7 @@
_UpdateSprites:
- ld h, $c1
+ ld h, wSpriteStateData1 / $100
inc h
- ld a, $e ; wSpriteStateData2 + $0e
+ ld a, $e ; (wSpriteStateData2 + $0e) & $ff
.spriteLoop
ld l, a
sub $e
@@ -24,9 +24,12 @@ _UpdateSprites:
jr nz, .spriteLoop
ret
.updateCurrentSprite
- cp $1
- jp nz, UpdateNonPlayerSprite
- jp UpdatePlayerSprite
+ ld a, [H_CURRENTSPRITEOFFSET]
+ and a
+ jp z, UpdatePlayerSprite
+ cp $f0 ; pikachu
+ jp z, SpawnPikachu
+ ld a, [hl]
UpdateNonPlayerSprite:
dec a
@@ -51,11 +54,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, wSpriteStateData1 / $100
ld a, [H_CURRENTSPRITEOFFSET]
- add wSpriteStateData1 % $100
ld l, a
ld a, [hl] ; a = [$c1i0] (picture) (0 if slot is unused)
@@ -270,6 +272,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
+ ld a, [$ff8f]
+ cp $f
+ jr nz, .asm_4cd9
+ call Func_4d0a
+ jr .asm_4cef
+.asm_4cd9
ld a, [$ff91] ; a = 7 or 9 depending on sprite i's delta X
ld b, a
ld a, [$ff90] ; a = 7 or 9 depending on sprite i's delta Y
@@ -294,6 +307,7 @@ DetectCollisionBetweenSprites:
; set bit in [$c1ie] or [$c1if] to indicate which sprite the collision occurred with
inc l
inc l
+.asm_4cef
ld a, [$ff8f] ; a = loop counter
ld de, SpriteCollisionBitTable
add a
@@ -322,6 +336,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:
+ ld a, [$ff91]
+ ld b, a
+ ld a, [$ff90]
+ 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/map_sprites.asm b/engine/overworld/map_sprites.asm
index 8a6057a0..3e2c3912 100755
--- a/engine/overworld/map_sprites.asm
+++ b/engine/overworld/map_sprites.asm
@@ -8,261 +8,23 @@
; fields, respectively, within loops. The X is the loop index.
; If there is an inner loop, Y is the inner loop index, i.e. $C1Y* and $C2Y*
; 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, wSpriteStateData1
- ld de, wSpriteStateData2 + $0d
-; Loop to copy picture ID's from $C1X0 to $C2XD for LoadMapSpriteTilePatterns.
-.copyPictureIDLoop
- ld a, [hl] ; $C1X0 (picture ID)
- ld [de], a ; $C2XD
- 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, wSpriteStateData2 + $0d
- xor a
- ld [hFourTileSpriteCount], a
-.copyPictureIDLoop ; loop to copy picture ID from $C2XD to $C2XE
- ld a, [hli] ; $C2XD (sprite picture ID)
- ld [hld], a ; $C2XE
- ld a, l
- add $10
- ld l, a
- dec b
- jr nz, .copyPictureIDLoop
- ld hl, wSpriteStateData2 + $1e
-.loadTilePatternLoop
- ld de, wSpriteStateData2 + $1d
-; 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, wSpriteStateData2 + $0e
- 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] ; $C2YE (VRAM slot)
- 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] ; $C2XE (sprite picture ID)
- ld b, a ; b = current sprite picture ID
- cp SPRITE_BALL ; is it a 4-tile sprite?
- jr c, .notFourTileSprite
- pop af
- ld a, [hFourTileSpriteCount]
- add 11
- jr .storeVRAMSlot
-.notFourTileSprite
- pop af
-.storeVRAMSlot
- ld [hl], a ; store VRAM slot at $C2XE
- ld [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, $c0 ; number of bytes per VRAM slot
- ld a, [hVRAMSlot]
- cp 11 ; is it a 4-tile sprite?
- jr nc, .fourTileSpriteVRAMAddr
- ld d, a
- dec d
-; Equivalent to multiplying $C0 (number of bytes in 12 tiles) times the VRAM
-; slot and adding the result to $8000 (the VRAM base address).
-.calculateVRAMAddrLoop
- add hl, bc
- dec d
- jr nz, .calculateVRAMAddrLoop
- jr .loadStillTilePattern
-.fourTileSpriteVRAMAddr
- ld hl, vSprites + $7c0 ; address for second 4-tile sprite
- ld a, [hFourTileSpriteCount]
- and a
- jr nz, .loadStillTilePattern
-; if it's the first 4-tile sprite
- ld hl, vSprites + $780 ; address for first 4-tile sprite
- inc a
- ld [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
- ld 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 = VRAM slot for the current picture ID (from $C2YE)
- ld [hl], a ; store VRAM slot in current wSpriteStateData2 sprite slot (at $C2XE)
-.nextSpriteSlot
- ld a, l
- add $10
- ld l, a
- dec c
- jp nz, .loadTilePatternLoop
- ld hl, wSpriteStateData2 + $0d
- ld b, $10
-; the pictures ID's stored at $C2XD are no longer needed, so zero them
-.zeroStoredPictureIDLoop
- xor a
- ld [hl], a ; $C2XD
- 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.
; sets carry if the map is a city or route, unsets carry if not
InitOutsideMapSprites:
ld a, [wCurMap]
- cp REDS_HOUSE_1F ; is the map a city or a route (map ID less than $25)?
+ cp a, REDS_HOUSE_1F ; is the map a city or a route (map ID less than $25)?
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?
@@ -274,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, wSpriteStateData2 + $0d
- ld a, SPRITE_RED
- ld [hl], a
- ld bc, wSpriteSet
-; Load the sprite set into RAM.
-; This loop also fills $C2XD (sprite picture ID) where X is from $0 to $A
-; with picture ID's. 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 ; $C2XD (sprite picture ID)
- 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 ; $C2XD (sprite picture ID)
- 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, wSpriteStateData2 + $1e
- 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 ; $C2XE (VRAM slot)
- ld a, $10
- add l
- ld l, a
- dec b
- jr nz, .zeroVRAMSlotsLoop
.skipLoadingSpriteSet
- ld hl, wSpriteStateData1 + $10
+ 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] ; $C1X0 (picture ID) (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 ; $C2XE (VRAM slot)
- 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 SPRITE_BALL ; 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
+ ld [hVRAMSlot], a
+ cp 9
+ jr nc, .fourTileSprite
+ call LoadStillTilePattern
+ call LoadWalkingTilePattern
+ jr .continue
+
+.fourTileSprite
+ call LoadStillTilePattern
+.continue
+ ld a, [hVRAMSlot]
+ inc a
+ cp 11
+ jr nz, .loop
+ ret
+
+ReloadWalkingTilePatterns:
+ xor a
+.loop
+ ld [hVRAMSlot], a
+ cp 9
+ jr nc, .fourTileSprite
+ call LoadWalkingTilePattern
+.fourTileSprite
+ ld 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
+ ld 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:
+ ld 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
+ ld [hVRAMSlot], a ; store current sprite set slot as a counter
+ ld a, [hl] ; $c1x0 (picture ID)
+ and a ; is the sprite unused?
+ jr z, .spriteUnused
+ call Func_14179
+ push hl
+ ld de, (wSpritePlayerStateData2ImageBaseOffset) - (wSpriteStateData1) ; $10e
+ add hl, de ; get $c2xe (sprite image base offset)
+ ld [hl], a ; write offset
+ pop hl
+.spriteUnused
+ ld de, wSprite02StateData1 - wSprite01StateData1
+ add hl, de
+ ld 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 a, $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 8587c0f7..dd601451 100644
--- a/engine/overworld/missable_objects.asm
+++ b/engine/overworld/missable_objects.asm
@@ -17,33 +17,30 @@ MarkTownVisitedAndLoadMissableObjects:
ld h, [hl]
; fall through
-LoadMissableObjects:
+; LoadMissableObjects:
+; seems to not exist in yellow (predef replaced with something near TryPushingBoulder)
ld l, a
push hl
- ld de, MapHS00 ; calculate difference between out pointer and the base pointer
ld a, l
- sub e
- jr nc, .asm_f13c
- dec h
-.asm_f13c
+ sub MapHS00 & $ff ; calculate difference between out pointer and the base pointer
ld l, a
ld a, h
- sub d
+ sbc MapHS00 / $100
ld h, a
ld a, h
ld [H_DIVIDEND], a
ld a, l
- ld [H_DIVIDEND+1], a
+ ld [H_DIVIDEND + 1], a
xor a
- ld [H_DIVIDEND+2], a
- ld [H_DIVIDEND+3], a
+ ld [H_DIVIDEND + 2], a
+ ld [H_DIVIDEND + 3], a
ld a, $3
ld [H_DIVISOR], a
ld b, $2
call Divide ; divide difference by 3, resulting in the global offset (number of missable items before ours)
ld a, [wCurMap]
ld b, a
- ld a, [H_DIVIDEND+3]
+ ld a, [H_DIVIDEND + 3]
ld c, a ; store global offset in c
ld de, wMissableObjectList
pop hl
diff --git a/engine/overworld/movement.asm b/engine/overworld/movement.asm
index f272f497..f2334479 100644
--- a/engine/overworld/movement.asm
+++ b/engine/overworld/movement.asm
@@ -22,7 +22,13 @@ UpdatePlayerSprite:
ld [wSpriteStateData1 + 2], a
ret
.lowerLeftTileIsMapTile
+ ld a, [wUpdateSpritesEnabled]
+ push af
+ ld a, $ff
+ ld [wUpdateSpritesEnabled], a
call DetectCollisionBetweenSprites
+ pop af
+ ld [wUpdateSpritesEnabled], a
ld h, wSpriteStateData1 / $100
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 [wSpriteStateData1 + 7], a
ld [wSpriteStateData1 + 8], a
- jr .calcImageIndex
-.next
- ld [wSpriteStateData1 + 9], a ; facing direction
- 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
- ld a, [H_CURRENTSPRITEOFFSET]
- 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, [wSpriteStateData1 + 8]
- ld b, a
- ld a, [wSpriteStateData1 + 9]
- add b
- ld [wSpriteStateData1 + 2], 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
@@ -97,18 +85,15 @@ UpdatePlayerSprite:
jr nz, .next2
ld a, $80
.next2
- ld [wSpriteStateData2 + 7], a
+ ld [wSpriteStateData2 + $07], a
ret
-UnusedReadSpriteDataFunction:
- push bc
- push af
- ld a, [H_CURRENTSPRITEOFFSET]
- ld c, a
- pop af
- add c
- ld l, a
- pop bc
+Func_4e32:
+ ld a, [wSpriteStateData1 + 8]
+ ld b, a
+ ld a, [wSpritePlayerStateData1FacingDirection]
+ add b
+ ld [wSpriteStateData1 + 2], a
ret
UpdateNPCSprite:
@@ -121,7 +106,7 @@ UpdateNPCSprite:
ld l, a
ld a, [hl] ; read movement byte 2
ld [wCurSpriteMovement2], a
- ld h, $c1
+ ld h, wSpriteStateData1 / $100
ld a, [H_CURRENTSPRITEOFFSET]
ld l, a
inc l
@@ -130,7 +115,7 @@ UpdateNPCSprite:
jp z, InitializeSpriteStatus
call CheckSpriteAvailability
ret c ; if sprite is invisible, on tile >=MAP_TILESET_SIZE, in grass or player is currently walking
- ld h, $c1
+ ld h, wSpriteStateData1 / $100
ld a, [H_CURRENTSPRITEOFFSET]
ld l, a
inc l
@@ -146,19 +131,21 @@ UpdateNPCSprite:
jp z, UpdateSpriteMovementDelay ; c1x1 == 2
cp $3
jp z, UpdateSpriteInWalkingAnimation ; c1x1 == 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)
call InitializeSpriteScreenPosition
- ld h, $c2
+ ld h, wSpriteStateData2 / $100
ld a, [H_CURRENTSPRITEOFFSET]
add $6
ld l, a
ld a, [hl] ; c2x6: movement byte 1
inc a
- jr z, .randomMovement ; value $FF
+ jp z, .randomMovement ; value $FF
inc a
- jr z, .randomMovement ; value $FE
+ jp z, .randomMovement ; value $FE
; 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 $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,59 +256,25 @@ ChangeFacingDirection:
; set carry on failure, clears carry on success
TryWalking:
push hl
- ld h, $c1
- ld a, [H_CURRENTSPRITEOFFSET]
- add $9
- ld l, a
- ld [hl], c ; c1x9 (update facing direction)
- ld a, [H_CURRENTSPRITEOFFSET]
- add $3
- ld l, a
- ld [hl], d ; c1x3 (update Y movement delta)
- inc l
- inc l
- ld [hl], e ; c1x5 (update X movement delta)
+ 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, $c2
+ ret c
+ call Func_5349
ld a, [H_CURRENTSPRITEOFFSET]
- add $4
ld l, a
- ld a, [hl] ; c2x4: Y position
- add d
- ld [hli], a ; update Y position
- ld a, [hl] ; c2x5: X position
- add e
- ld [hl], a ; update X position
- ld a, [H_CURRENTSPRITEOFFSET]
- ld l, a
- ld [hl], $10 ; c2x0=16: walk animation counter
+ ld [hl], $10 ; c1x9 (update facing direction)
dec h
inc l
- ld [hl], $3 ; c1x1: set movement status to walking
+ ld [hl], $3
jp UpdateSpriteImage
; update the walking animation parameters for a sprite that is currently walking
UpdateSpriteInWalkingAnimation:
- ld a, [H_CURRENTSPRITEOFFSET]
- add $7
- ld l, a
- ld a, [hl] ; c1x7 (counter until next walk animation frame)
- inc a
- ld [hl], a ; c1x7 += 1
- cp $4
- jr nz, .noNextAnimationFrame
- xor a
- ld [hl], a ; c1x7 = 0
- inc l
- ld a, [hl] ; c1x8 (walk animation frame)
- inc a
- and $3
- ld [hl], a ; advance to next animation frame every 4 ticks (16 ticks total for one step)
+ call Func_5274
.noNextAnimationFrame
ld a, [H_CURRENTSPRITEOFFSET]
add $3
@@ -446,6 +405,7 @@ InitializeSpriteStatus:
ld a, $8
ld [hli], a ; $c2x2: set Y displacement to 8
ld [hl], a ; $c2x3: set X displacement to 8
+ call InitializeSpriteScreenPosition ; could have done fallthrough here
ret
; calculates the sprite's screen position form its map position and the player position
@@ -458,7 +418,7 @@ InitializeSpriteScreenPosition:
ld b, a
ld a, [hl] ; c2x4 (Y position + 4)
sub b ; relative to player position
- swap a ; * 16
+ call Func_5033
sub $4 ; - 4
dec h
ld [hli], a ; c1x4 (screen Y position)
@@ -467,11 +427,23 @@ InitializeSpriteScreenPosition:
ld b, a
ld a, [hli] ; c2x6 (X position + 4)
sub b ; relative to player position
- swap a ; * 16
+ call Func_5033
dec h
ld [hl], a ; c1x6 (screen X position)
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
@@ -591,17 +563,9 @@ 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
- ld h, $c2
+ call _IsTilePassable
+ jr c, .impassable
+ ld h, wSpriteStateData2 / $100
ld a, [H_CURRENTSPRITEOFFSET]
add $6
ld l, a
@@ -624,7 +588,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, wSpriteStateData1 / $100
@@ -643,7 +613,7 @@ CanWalkOntoTile:
jr nz, .upwards
add d
cp $5
- jr c, .impassable ; if c2x2+d < 5, don't go ;bug: this tests probably were supposed to prevent sprites
+ ;jr c, .impassable (bugfix) ; if c2x2+d < 5, don't go ;bug: this tests probably were supposed to prevent sprites
jr .checkHorizontal ; from walking out too far, but this line makes sprites get stuck
.upwards ; whenever they walked upwards 5 steps
sub $1 ; on the other hand, the amount a sprite can walk out to the
@@ -665,7 +635,7 @@ CanWalkOntoTile:
and a ; clear carry (marking success)
ret
.impassable
- ld h, $c1
+ ld h, wSpriteStateData1 / $100
ld a, [H_CURRENTSPRITEOFFSET]
inc a
ld l, a
@@ -697,7 +667,7 @@ GetTileSpriteStandsOn:
ld l, a
ld a, [hli] ; c1x4: screen Y position
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
@@ -863,20 +833,235 @@ AnimScriptedNPCMovement:
ret
AdvanceScriptedNPCAnimFrameCounter:
+ call Func_5274
+ ld h, wSpriteStateData1 / $100
ld a, [H_CURRENTSPRITEOFFSET]
- add $7
+ add $8
ld l, a
ld a, [hl] ; intra-animation frame counter
+ and $3
+ ld [hSpriteAnimFrameCounter], a
+ ret
+
+Func_5274:
+ ld a, [H_CURRENTSPRITEOFFSET]
+ add $7
+ ld l, a
+ ld h, wSpriteStateData1 / $100
+ ld a, [hl] ; c1x7 (counter until next walk animation frame)
inc a
+ and $3
+ ld [hl], a ; c1x7 += 1
+ ret nz ; c1x7 = 0
+ inc l
+ ld a, [hl] ; c1x8 (walk animation frame)
+ 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
+ ld a, [H_CURRENTSPRITEOFFSET]
+ ld l, a
+ ld [hl], $8
+ dec h
+ inc l
+ ld [hl], $4
+ call UpdateSpriteImage
+ scf
+ ret
+
+.asm_52fa
+ call Func_5337
+ ld a, [H_CURRENTSPRITEOFFSET]
+ 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
+ ld a, [H_CURRENTSPRITEOFFSET]
+ 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:
+ ld a, [H_CURRENTSPRITEOFFSET]
+ add $9
+ ld l, a
+ ld h, wSpriteStateData1 / $100
+ ld [hl], c ; c1x9 (update facing direction)
+ ld a, [H_CURRENTSPRITEOFFSET]
+ add $3
+ ld l, a
+ ld [hl], d ; c1x3 (update Y movement delta)
+ inc l
+ inc l
+ ld [hl], e ; c1x5 (update X movement delta)
+ ret
+
+Func_5349:
+ ld h, wSpriteStateData2 / $100
+ ld a, [H_CURRENTSPRITEOFFSET]
+ add $4
+ ld l, a
+ ld a, [hl] ; c2x4: Y position
+ add d
+ ld [hli], a ; update Y position
+ ld a, [hl] ; c2x5: X position
+ add e
+ ld [hl], a ; update X position
+ ret
+
+Func_5357:
+ call Func_5274
+ ld a, [H_CURRENTSPRITEOFFSET]
+ add $3
+ ld l, a
+ ld h, wSpriteStateData1 / $100
+ 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
- cp 4
+ ld a, [H_CURRENTSPRITEOFFSET]
+ ld l, a
+ ld h, wSpriteStateData2 / $100
+ dec [hl]
ret nz
+ ld a, $6
+ add l
+ ld l, a
+ ld a, [hl]
+ cp $fe
+ jr nc, .asm_5386
+ ld a, [H_CURRENTSPRITEOFFSET]
+ inc a
+ ld l, a
+ ld h, wSpriteStateData1 / $100
+ ld [hl], $1
+ ret
+.asm_5386
+ call Random
+ ld a, [H_CURRENTSPRITEOFFSET]
+ add $8
+ ld l, a
+ ld h, wSpriteStateData2 / $100
+ ld a, [hRandomAdd]
+ and $7f
+ ld [hl], a
+ dec h
+ ld a, [H_CURRENTSPRITEOFFSET]
+ inc a
+ ld l, a
+ ld [hl], $2
+ inc l
+ inc l
xor a
- ld [hl], a ; reset intra-animation frame counter
+ ld b, [hl]
+ ld [hli], a
inc l
- ld a, [hl] ; animation frame counter
- inc a
- and $3
+ ld c, [hl]
ld [hl], a
- ld [hSpriteAnimFrameCounter], a
ret
diff --git a/engine/overworld/npc_movement.asm b/engine/overworld/npc_movement.asm
index 968615f0..670cb121 100755
--- a/engine/overworld/npc_movement.asm
+++ b/engine/overworld/npc_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, $05
+ db NPC_MOVEMENT_DOWN, $06 ; differs from red
db NPC_MOVEMENT_LEFT, $01
db NPC_MOVEMENT_DOWN, $05
db NPC_MOVEMENT_RIGHT, $03
@@ -141,7 +146,7 @@ RLEList_PlayerWalkToLab:
db D_RIGHT, $03
db D_DOWN, $05
db D_LEFT, $01
- db D_DOWN, $06
+ db D_DOWN, $07 ; differs from red
db $FF
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, $03
db $FF
-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 $ff
- jr z, .notRival
- cp b
- ret z ; the rival leaves after battling, so don't freeze him
- jr .loop
-.notRival
- ld a, [wSpriteIndex]
- ld [H_SPRITEINDEX], a
- jp SetSpriteMovementBytesToFF
-
-RivalIDs:
- db OPP_SONY1
- db OPP_SONY2
- db OPP_SONY3
- db $ff
+INCLUDE "engine/overworld/pewter_guys.asm"
diff --git a/engine/overworld/npc_movement_2.asm b/engine/overworld/npc_movement_2.asm
new file mode 100755
index 00000000..93d1afce
--- /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 $ff
+ jr z, .notRival
+ cp b
+ ret z ; the rival leaves after battling, so don't freeze him
+ jr .loop
+.notRival
+ ld a, [wSpriteIndex]
+ ld [H_SPRITEINDEX], a
+ jp SetSpriteMovementBytesToFF
+
+RivalIDs:
+ db OPP_SONY1
+ db OPP_SONY2
+ db OPP_SONY3
+ db $ff
diff --git a/engine/overworld/oam.asm b/engine/overworld/oam.asm
index 2c2a3dff..5a831327 100644
--- a/engine/overworld/oam.asm
+++ b/engine/overworld/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
ld [hSpriteOffset2], a
- ld d, wSpriteStateData1 / $100
- ld a, [hSpriteOffset2]
ld e, a
+ ld d, wSpriteStateData1 / $100
+
ld a, [de] ; c1x0
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:
ld [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
ld a, [hOAMBufferOffset]
+ add [hl]
+ cp $a0
+ jr z, .hidden
+ jr nc, .asm_4a41
+.hidden
+ call Func_4a7b
+ ld [wd5cd], a
+ ld a, [hOAMBufferOffset]
+
ld e, a
ld d, wOAMBuffer / $100
.tileLoop
+ ld a, [hli]
+ ld c, a
+.loop
ld 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
ld 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 c1x2
- 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
+ ld a, [$fffc]
+ add b
+.asm_4a1c
ld [de], a ; tile id
inc hl
inc e
@@ -129,15 +118,19 @@ PrepareOAMData:
ld a, [hSpritePriority]
or [hl]
.skipPriority
- inc hl
+ and $f0
+ bit 4, a ; OBP0 or OBP1
+ jr z, .spriteusesOBP0
+ or %100 ; palettes 4-7 are OBP1
+.spriteusesOBP0
ld [de], a
+ inc hl
inc e
- bit 0, a ; OAMFLAG_ENDOFDATA
- jr z, .tileLoop
+ dec c
+ jr nz, .loop
ld a, e
ld [hOAMBufferOffset], a
-
.nextSprite
ld a, [hSpriteOffset2]
add $10
@@ -145,26 +138,31 @@ PrepareOAMData:
jp nz, .spriteLoop
; Clear unused OAM.
- ld a, [hOAMBufferOffset]
- ld l, a
- ld h, wOAMBuffer / $100
- 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
+ ld a, [hOAMBufferOffset]
+ cp c
+ ret nc
+ ld l, a
+ ld h, wOAMBuffer / $100
+ 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 ; c1xb (x)
ret
+
+Func_4a7b:
+ push bc
+ ld a, [wd5cd] ; temp copy of c1x2
+ 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/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 a,$ff
+ jr z,.tileNotPassable
+ cp c
+ jr nz,.loop
+ xor a
+ ret
+.tileNotPassable
+ scf
+ ret
+
+INCLUDE "data/collision.asm" ; probably
diff --git a/engine/overworld/player_animations.asm b/engine/overworld/player_animations.asm
index a17e67bd..d4ecec53 100755
--- 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), $0c
call CopyVideoData
ld de, BirdSprite + $c0 ; moving animation sprite
+ ld b, BANK(BirdSprite)
+ ld c, $0c
ld hl, vNPCSprites2
- lb bc, BANK(BirdSprite), $0c
jp CopyVideoData
InitFacingDirectionList:
@@ -386,9 +393,10 @@ FishingAnim:
call DelayFrames
ld hl, wd736
set 6, [hl] ; reserve the last 4 OAM entries
- ld de, RedSprite
ld hl, vNPCSprites
- lb bc, BANK(RedSprite), $c
+ ld de, RedSprite
+ ld b, BANK(RedSprite)
+ ld c, $c
call CopyVideoData
ld a, $4
ld hl, RedFishingTiles
diff --git a/engine/overworld/player_state.asm b/engine/overworld/player_state.asm
index 73c55da2..8cbacc61 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/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
@@ -240,8 +242,7 @@ PrintSafariZoneSteps:
cp CERULEAN_CAVE_2F
ret nc
coord hl, 0, 0
- ld b, 3
- ld c, 7
+ lb bc, 3, 7
call TextBoxBorder
coord hl, 1, 1
ld de, wSafariSteps
@@ -255,11 +256,11 @@ PrintSafariZoneSteps:
call PlaceString
ld a, [wNumSafariBalls]
cp 10
- jr nc, .asm_c56d
+ jr nc, .numSafariBallsTwoDigits
coord hl, 5, 3
ld a, " "
ld [hl], a
-.asm_c56d
+.numSafariBallsTwoDigits
coord hl, 6, 3
ld de, wNumSafariBalls
lb bc, 1, 2
@@ -361,16 +362,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/poison.asm b/engine/overworld/poison.asm
index 5d8eb9fd..03fb8a65 100644
--- a/engine/overworld/poison.asm
+++ b/engine/overworld/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
ld [hSpriteIndexOrTextID], a
call DisplayTextID
+ callab IsThisPartymonStarterPikachu_Party
+ jr nc, .curMonNotPlayerPikachu
+ ld e, $3
+ callab 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/overworld/pokecenter.asm b/engine/overworld/pokecenter.asm
index f26bedf8..cf0159f9 100755
--- a/engine/overworld/pokecenter.asm
+++ b/engine/overworld/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
+ callab IsStarterPikachuInOurParty
+ jr nc, .notHealingPlayerPikachu
+ call CheckPikachuFollowingPlayer
+ jr nz, .notHealingPlayerPikachu
+ call LoadCurrentMapView
+ call Delay3
+ call UpdateSprites
+ callab PikachuWalksToNurseJoy ; todo
+.notHealingPlayerPikachu
ld hl, NeedYourPokemonText
call PrintText
- ld a, $18
- ld [wSpriteStateData1 + $12], 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
+ callab IsStarterPikachuInOurParty
+ call c, Func_6eaa
+.playerPikachuNotOnScreen
+ lb bc, 1, 8
+ call Func_6ebb
+ ld c, 30
+ call DelayFrames
callba 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
+ callab 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 [wSpriteStateData1 + $12], a ; make the nurse bow
- ld c, a
+ callab IsStarterPikachuInOurParty
+ jr nc, .notInParty
+ lb bc, 15, 0
+ call Func_6ebb
+.notInParty
+ call LoadCurrentMapView
+ call Delay3
+ call UpdateSprites
+ callab ReloadWalkingTilePatterns
+ ld a, $1
+ ld [H_SPRITEINDEX], a
+ ld a, $1
+ ld [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
+ ld [H_SPRITEINDEX], a
+ ld a, $4
+ ld [hSpriteImageIndex], a
+ call SpriteFunc_34a1
+ ld c, 64
+ call DelayFrames
+ ret
+
+Func_6ebb:
+ ld a, b
+ ld [H_SPRITEINDEX], a
+ ld a, c
+ ld [hSpriteImageIndex], a
+ push bc
+ call SetSpriteFacingDirectionAndDelay
+ pop bc
+ ld a, b
+ ld [H_SPRITEINDEX], a
+ ld a, c
+ ld [hSpriteImageIndex], a
+ call SpriteFunc_34a1
+ ret
PokemonCenterWelcomeText:
TX_FAR _PokemonCenterWelcomeText
@@ -66,3 +143,7 @@ PokemonCenterFarewellText:
TX_DELAY
TX_FAR _PokemonCenterFarewellText
db "@"
+
+LooksContentText:
+ TX_FAR _LooksContentText
+ db "@"
diff --git a/engine/overworld/push_boulder.asm b/engine/overworld/push_boulder.asm
index c91605a8..8a385345 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
@@ -36,7 +38,7 @@ TryPushingBoulder:
jp nz, ResetBoulderPushFlags
ld a, [hJoyHeld]
ld b, a
- ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction
+ ld a, [wSpritePlayerStateData1FacingDirection] ; player's sprite facing direction
cp SPRITE_FACING_UP
jr z, .pushBoulderUp
cp SPRITE_FACING_LEFT
diff --git a/engine/overworld/ssanne.asm b/engine/overworld/ssanne.asm
index ea4747ce..cf3b1284 100755
--- a/engine/overworld/ssanne.asm
+++ b/engine/overworld/ssanne.asm
@@ -7,6 +7,7 @@ AnimateBoulderDust:
ld [wUpdateSpritesEnabled], a
ld a, %11100100
ld [rOBP1], a
+ call UpdateGBCPal_OBP1
call LoadSmokeTileFourTimes
callba WriteCutOrBoulderDustAnimationOAMBlock
ld c, 8 ; number of steps in animation
@@ -21,6 +22,7 @@ AnimateBoulderDust:
ld a, [rOBP1]
xor %01100100
ld [rOBP1], a
+ call UpdateGBCPal_OBP1
call Delay3
pop bc
dec c
@@ -30,7 +32,7 @@ AnimateBoulderDust:
jp LoadPlayerSpriteGraphics
GetMoveBoulderDustFunctionPointer:
- ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction
+ ld a, [wSpritePlayerStateData1FacingDirection] ; player's sprite facing direction
ld hl, MoveBoulderDustFunctionPointerTable
ld c, a
ld b, $0
diff --git a/engine/overworld/tileset_header.asm b/engine/overworld/tileset_header.asm
index 6e33974f..05061651 100644
--- a/engine/overworld/tileset_header.asm
+++ b/engine/overworld/tileset_header.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]
ld [hTilesetType], 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
ld a, [hPreviousTileset]
cp b
jr z, .done
-.asm_c797
+.notDungeonTileset
ld a, [wDestinationWarpID]
cp $ff
jr z, .done
diff --git a/engine/palettes.asm b/engine/palettes.asm
index 39991d48..ec9816ab 100755
--- a/engine/palettes.asm
+++ b/engine/palettes.asm
@@ -19,7 +19,7 @@ _RunPaletteCommand:
push de
jp hl
-SetPal_BattleBlack:
+SetPal_Black:
ld hl, PalPacket_Black
ld de, BlkPacket_Battle
ret
@@ -30,11 +30,19 @@ SetPal_Battle:
ld de, wPalPacket
ld bc, $10
call CopyData
- ld a, [wPlayerBattleStatus3]
+ ;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 a, [wEnemyBattleStatus3]
ld hl, wEnemyMonSpecies2
call DeterminePaletteID
ld c, a
@@ -110,7 +118,7 @@ SetPal_Slots:
ld de, BlkPacket_Slots
ret
-SetPal_TitleScreen:
+SetPal_Titlescreen:
ld hl, PalPacket_Titlescreen
ld de, BlkPacket_Titlescreen
ret
@@ -155,6 +163,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 +190,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,14 +255,24 @@ 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:
- dw SetPal_BattleBlack
+ dw SetPal_Black
dw SetPal_Battle
dw SetPal_TownMap
dw SetPal_StatusScreen
dw SetPal_Pokedex
dw SetPal_Slots
- dw SetPal_TitleScreen
+ dw SetPal_Titlescreen
dw SetPal_NidorinoIntro
dw SetPal_Generic
dw SetPal_Overworld
@@ -255,6 +280,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.
@@ -269,9 +296,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
@@ -289,6 +313,132 @@ DeterminePaletteIDOutOfBattle:
ld a, [hl]
ret
+YellowIntroPaletteAction::
+ ld a, e
+ and a
+ jr nz, .asm_720bd
+ ld hl, PalPacket_Generic
+ ld a, [hGBC]
+ and a
+ jp z, SendSGBPacket
+ jp InitGBCPalettes
+
+.asm_720bd
+ ld hl, UnknownPalPacket_72811
+ ld 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
+ ld 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
+ ld 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
@@ -324,6 +474,14 @@ UpdatePartyMenuBlkPacket:
ret
SendSGBPacket:
+ ld a, 1
+ ld [hDisableJoypadPolling], a ; don't poll joypad while sending packet
+ call _SendSGBPacket
+ xor a
+ ld [hDisableJoypadPolling], a
+ ret
+
+_SendSGBPacket:
;check number of packets
ld a, [hl]
and $07
@@ -333,9 +491,6 @@ SendSGBPacket:
.loop2
; save B for later use
push bc
-; disable ReadJoypad to prevent it from interfering with sending the packet
- ld a, 1
- ld [hDisableJoypadPolling], a
; send RESET signal (P14=LOW, P15=LOW)
xor a
ld [rJOYP], a
@@ -352,18 +507,18 @@ SendSGBPacket:
ld d, a
.nextBit0
bit 0, d
-; if 0th bit is not zero set P14=HIGH,P15=LOW (send bit 1)
+; if 0th bit is not zero set P14=HIGH, P15=LOW (send bit 1)
ld a, $10
jr nz, .next0
-; else (if 0th bit is zero) set P14=LOW,P15=HIGH (send bit 0)
+; else (if 0th bit is zero) set P14=LOW, P15=HIGH (send bit 0)
ld a, $20
.next0
ld [rJOYP], a
-; must set P14=HIGH,P15=HIGH between each "pulse"
+; must set P14=HIGH, P15=HIGH between each "pulse"
ld a, $30
ld [rJOYP], a
; rotation will put next bit in 0th position (so we can always use command
-; "bit 0,d" to fetch the bit that has to be sent)
+; "bit 0, d" to fetch the bit that has to be sent)
rr d
; decrease bit counter so we know when we have sent all 8 bits of current byte
dec e
@@ -373,11 +528,9 @@ SendSGBPacket:
; send bit 1 as a "stop bit" (end of parameter data)
ld a, $20
ld [rJOYP], a
-; set P14=HIGH,P15=HIGH
+; set P14=HIGH, P15=HIGH
ld a, $30
ld [rJOYP], a
- xor a
- ld [hDisableJoypadPolling], a
; wait for about 70000 cycles
call Wait7000
; restore (previously pushed) number of packets
@@ -392,14 +545,17 @@ LoadSGB:
xor a
ld [wOnSGB], a
call CheckSGB
- ret nc
- ld a, 1
- ld [wOnSGB], a
- ld a, [wGBC]
+ jr c, .onSGB
+ ld 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
@@ -442,23 +598,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
- ld [hDisableJoypadPolling], a
- ei
call Wait7000
ld a, [rJOYP]
and $3
@@ -514,6 +666,7 @@ CopyGfxToSuperNintendoVRAM:
call DisableLCD
ld a, $e4
ld [rBGP], a
+ call _UpdateGBCPal_BGP_CheckDMG
ld de, vChars1
ld a, [wCopyingSGBTileData]
and a
@@ -544,6 +697,7 @@ CopyGfxToSuperNintendoVRAM:
call SendSGBPacket
xor a
ld [rBGP], a
+ call _UpdateGBCPal_BGP_CheckDMG
ei
ret
@@ -561,13 +715,17 @@ Wait7000:
ret
SendSGBPackets:
- ld a, [wGBC]
+ ld a, [hGBC]
and a
jr z, .notGBC
push de
call InitGBCPalettes
pop hl
- call EmptyFunc5
+ call InitGBCPalettes
+ ld a, [rLCDC]
+ and rLCDC_ENABLE_MASK
+ ret z
+ call Delay3
ret
.notGBC
push de
@@ -576,30 +734,349 @@ SendSGBPackets:
jp SendSGBPacket
InitGBCPalettes:
- ld a, $80 ; index 0 with auto-increment
- ld [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
+ ld a, [rBGP]
+ ld [wLastBGP], a
+ jr .convert
+.notBGP
+ dec a
+ jr nz, .notOBP0
+ ld a, [rOBP0]
+ ld [wLastOBP0], a
+ jr .convert
+.notOBP0
+ ld a, [rOBP1]
+ ld [wLastOBP1], a
+.convert
+color_index = 0
+ REPT NUM_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_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
- ld de, SuperPalettes
- add e
- jr nc, .noCarry
- inc d
-.noCarry
+ or $80 ; auto-increment
+ ld [rBGPI], a
+ ld de, rBGPD
+ ld hl, wGBCPal
+ ld b, %10 ; mask for non-V-blank/non-H-blank STAT mode
+ ld a, [rLCDC]
+ and rLCDC_ENABLE_MASK
+ jr nz, .lcdEnabled
+ rept NUM_COLORS
+ call TransferPalColorLCDDisabled
+ endr
+ jr .done
+.lcdEnabled
+ rept NUM_COLORS
+ call TransferPalColorLCDEnabled
+ endr
+.done
+ pop de
+ ret
+
+BufferBGPPal::
+; Copy wGBCPal to palette a in wBGPPalsBuffer.
+ push de
+ add a
+ add a
+ add a
+ ld l, a
+ xor a
+ ld h, a
+ ld de, wBGPPalsBuffer
+ add hl, de
+ ld de, wGBCPal
+ ld c, PAL_SIZE
+.loop
ld a, [de]
- ld [rBGPD], a
+ ld [hli], a
+ inc de
+ dec c
+ jr nz, .loop
+ pop de
+ ret
+
+TransferBGPPals::
+; Transfer the buffered BG palettes.
+ ld a, [rLCDC]
+ and rLCDC_ENABLE_MASK
+ jr z, .lcdDisabled
+ di
+.waitLoop
+ ld a, [rLY]
+ cp 144
+ jr c, .waitLoop
+.lcdDisabled
+ call .DoTransfer
+ ei
+ ret
+
+.DoTransfer:
+ xor a
+ or $80 ; auto-increment
+ ld [rBGPI], a
+ ld de, rBGPD
+ ld hl, wBGPPalsBuffer
+ ld c, 4 * PAL_SIZE
+.loop
+ ld a, [hli]
+ ld [de], a
dec c
jr nz, .loop
ret
-EmptyFunc5:
+TransferCurOBPData:
+ push de
+ add a
+ add a
+ add a
+ or $80 ; auto-increment
+ ld [rOBPI], a
+ ld de, rOBPD
+ ld hl, wGBCPal
+ ld b, %10 ; mask for non-V-blank/non-H-blank STAT mode
+ ld a, [rLCDC]
+ and rLCDC_ENABLE_MASK
+ jr nz, .lcdEnabled
+ rept NUM_COLORS
+ call TransferPalColorLCDDisabled
+ endr
+ jr .done
+.lcdEnabled
+ rept NUM_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.
+ ld a, [rSTAT]
+ and b
+ jr z, TransferPalColorLCDEnabled
+
+; Wait for H-blank or V-blank to begin.
+.notInBlankingPeriod
+ ld 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::
+ ld 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
+ callba 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
@@ -607,9 +1084,7 @@ CopySGBBorderTiles:
; This function converts 2BPP planar data into this format by mapping
; 2BPP colors 0-3 to 4BPP colors 0-3. 4BPP colors 4-15 are not used.
ld b, 128
-
.tileLoop
-
; Copy bit planes 1 and 2 of the tile data.
ld c, 16
.copyLoop
diff --git a/engine/pathfinding.asm b/engine/pathfinding.asm
index ba052d38..f3d23b7c 100644
--- a/engine/pathfinding.asm
+++ b/engine/pathfinding.asm
@@ -14,22 +14,22 @@ FindPathToPlayer:
call CalcDifference
ld d, a
and a
- jr nz, .asm_f8da
+ jr nz, .asm_f76a
ld a, [hFindPathFlags]
set 0, a ; current end of path matches the player's Y coordinate
ld [hFindPathFlags], a
-.asm_f8da
+.asm_f76a
ld a, [hFindPathXProgress]
ld b, a
ld a, [hNPCPlayerXDistance] ; X distance in steps
call CalcDifference
ld e, a
and a
- jr nz, .asm_f8ec
+ jr nz, .asm_f77c
ld a, [hFindPathFlags]
set 1, a ; current end of path matches the player's X coordinate
ld [hFindPathFlags], a
-.asm_f8ec
+.asm_f77c
ld a, [hFindPathFlags]
cp $3 ; has the end of the path reached the player's position?
jr z, .done
diff --git a/engine/pikachu_emotions.asm b/engine/pikachu_emotions.asm
new file mode 100755
index 00000000..1518b28e
--- /dev/null
+++ b/engine/pikachu_emotions.asm
@@ -0,0 +1,421 @@
+IsPlayerTalkingToPikachu:
+ ld a, [wd436]
+ and a
+ ret z
+ ld a, [hSpriteIndexOrTextID]
+ cp $f
+ ret nz
+ call InitializePikachuTextID
+ xor a
+ ld [hSpriteIndexOrTextID], a
+ ld [wd436], a
+ ret
+
+InitializePikachuTextID:
+ ld a, $d4 ; display
+ ld [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
+ callab 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:
+ ret
+
+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
+ ret
+
+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
+
+PikachuEmotionTable:
+pikaemotion_def: MACRO
+\1_id: dw \1
+ endm
+
+ 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
+ callab 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
+ callab 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 PIKACHU
+ jr nz, .curMonNotStarterPikachu
+ callab 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_emotions.asm"
+
+PikachuWalksToNurseJoy:
+ ld a, $40
+ ld [h_0xFFFC], a
+ call LoadPikachuSpriteIntoVRAM
+ call .GetMovementData
+ and a
+ jr z, .skip
+ call ApplyPikachuMovementData
+.skip
+ xor a
+ ld [h_0xFFFC], 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_follow.asm b/engine/pikachu_follow.asm
new file mode 100755
index 00000000..d9dc91df
--- /dev/null
+++ b/engine/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
+ callab 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
+ callab 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
+ ld 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 Pointer_fc8d6 % $100
+ ld l, a
+ ld a, Pointer_fc8d6 / $100
+ 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, wSpriteStateData2 / $100
+ ld a, [H_CURRENTSPRITEOFFSET] ; 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, wSpriteStateData1 / $100
+ ld a, [H_CURRENTSPRITEOFFSET]
+ add wSpritePikachuStateData1ImageIndex - wSpritePikachuStateData1
+ ld l, a
+ ld [hl], $ff
+ scf
+ jr .return
+
+.on_screen
+ ld h, wSpriteStateData2 / $100
+ ld a, [H_CURRENTSPRITEOFFSET]
+ 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, wSpriteStateData1 / $100
+ ld a, [H_CURRENTSPRITEOFFSET]
+ 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_movement.asm b/engine/pikachu_movement.asm
new file mode 100755
index 00000000..938715a4
--- /dev/null
+++ b/engine/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/ledge_hopping_shadow.1bpp"
+LedgeHoppingShadowGFX_3FEnd:
+
+LoadPikachuBallIconIntoVRAM:
+ ld hl, vNPCSprites2 + $7e * $10
+ ld de, GFX_fd86b
+ lb bc, BANK(GFX_fd86b), 1
+ jp CopyVideoDataDoubleAlternate
+
+Func_fd851:
+ ld hl, vNPCSprites + $c * $10
+ ld a, 3
+.loop
+ push af
+ push hl
+ ld de, GFX_fd86b
+ lb bc, BANK(GFX_fd86b), 4
+ call CopyVideoDataAlternate
+ pop hl
+ ld de, 4 * $10
+ add hl, de
+ pop af
+ dec a
+ jr nz, .loop
+ ret
+
+GFX_fd86b:
+INCBIN "gfx/unknown_fd86b.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
+ ld a, [h_0xFFFC]
+ 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_wave $100
diff --git a/engine/pikachu_pcm.asm b/engine/pikachu_pcm.asm
new file mode 100755
index 00000000..1e6f8dc2
--- /dev/null
+++ b/engine/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
+ ld [rNR52], a
+ ld a, $77
+ ld [rNR50], a
+ xor a
+ ld [rNR30], a
+ ld hl, $ff30 ; 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
+ ld [rNR30], a
+ ld a, [rNR51]
+ or $44
+ ld [rNR51], a
+ ld a, $ff
+ ld [rNR31], a
+ ld a, $20
+ ld [rNR32], a
+ ld a, $ff
+ ld [rNR33], a
+ ld a, $87
+ ld [rNR34], a
+ pop hl
+ pop bc
+ call PlayPikachuPCM
+ xor a
+ ld [wc0f3], a
+ ld [wc0f4], a
+ ld a, $80
+ ld [rNR52], a
+ xor a
+ ld [rNR30], a
+ ld hl, $ff30
+ 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
+ ld [rNR30], a
+ ld a, [rNR51]
+ and $bb
+ ld [rNR51], a
+ xor a
+ ld [wChannelSoundIDs + Ch5], a
+ ld [wChannelSoundIDs + Ch6], a
+ ld [wChannelSoundIDs + Ch7], a
+ ld [wChannelSoundIDs + Ch8], a
+ ld a, [H_LOADEDROMBANK]
+ 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_pic_animation.asm b/engine/pikachu_pic_animation.asm
new file mode 100755
index 00000000..c79d9add
--- /dev/null
+++ b/engine/pikachu_pic_animation.asm
@@ -0,0 +1,851 @@
+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:
+ ld a, [H_AUTOBGTRANSFERENABLED]
+ push af
+ xor a
+ ld [H_AUTOBGTRANSFERENABLED], a
+ ld a, [de]
+ ld [wPikaPicAnimNumber], a
+ inc de
+ push de
+ call .RunPikapic
+ pop de
+ pop af
+ ld [H_AUTOBGTRANSFERENABLED], a
+ ret
+
+.RunPikapic:
+ call PlacePikapicTextBoxBorder
+ callab 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
+ ld [H_AUTOBGTRANSFERENABLED], a
+ coord hl, 6, 5
+ lb bc, 5, 5
+ call TextBoxBorder
+ call Delay3
+ call UpdateSprites
+ ld a, $1
+ ld [H_AUTOBGTRANSFERENABLED], 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
+
+PikaPicAnimPointers:
+pikapic_def: macro
+\1_id: dw \1
+endm
+
+ 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
+ ld [H_AUTOBGTRANSFERENABLED], a
+ call RunPikaPicAnimSetupScript
+ call DummyFunction_fdad5
+ call AnimateCurrentPikaPicAnimFrame
+ call DummyFunction_fdad5
+ ld a, $1
+ ld [H_AUTOBGTRANSFERENABLED], a
+ call PikaPicAnimTimerAndJoypad
+ and a
+ jr z, .loop
+ ret
+
+PikaPicAnimTimerAndJoypad:
+ call Delay3
+ call CheckPikaPicAnimTimer
+ and a
+ ret nz
+ call JoypadLowSensitivity
+ ld 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_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
+ coord hl, 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_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
+ ld a, [H_AUTOBGTRANSFERENABLED]
+ push af
+ xor a
+ ld [H_AUTOBGTRANSFERENABLED], a
+ ld a, [hTilesetType]
+ push af
+ xor a
+ ld [hTilesetType], a
+ call GetPikaPicAnimByte
+ ld [wPikaPicAnimCurGraphicID], a
+ ld a, [wPikaPicAnimCurGraphicID]
+ call LoadPikaPicAnimGFXHeader
+ ld a, c
+ cp a, $ff
+ jr z, .compressed
+ call RequestPikaPicAnimGFX
+ jr .done
+
+.compressed
+ call DecompressRequestPikaPicAnimGFX
+.done
+ pop af
+ ld [hTilesetType], a
+ pop af
+ ld [H_AUTOBGTRANSFERENABLED], 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
+ callab 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
+ ld [rBGP], a
+ call UpdateGBCPal_BGP
+ call DelayFrames
+ ret
+
+INCLUDE "data/pikachu_pic_animation.asm"
diff --git a/engine/pikachu_status.asm b/engine/pikachu_status.asm
new file mode 100755
index 00000000..c73d3b3f
--- /dev/null
+++ b/engine/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 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 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 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/pokedex_rating.asm b/engine/pokedex_rating.asm
index f1aaf618..4dfb6b39 100755
--- a/engine/pokedex_rating.asm
+++ b/engine/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,104 +51,104 @@ DisplayDexRating:
ld [de], a
ret
-PokedexRatingText_441cc:
- TX_FAR _OaksLabText_441cc
+DexCompletionText:
+ TX_FAR _DexCompletionText
db "@"
DexRatingsTable:
db 10
- dw PokedexRatingText_44201
+ dw DexRatingText_Own0To9
db 20
- dw PokedexRatingText_44206
+ dw DexRatingText_Own10To19
db 30
- dw PokedexRatingText_4420b
+ dw DexRatingText_Own20To29
db 40
- dw PokedexRatingText_44210
+ dw DexRatingText_Own30To39
db 50
- dw PokedexRatingText_44215
+ dw DexRatingText_Own40To49
db 60
- dw PokedexRatingText_4421a
+ dw DexRatingText_Own50To59
db 70
- dw PokedexRatingText_4421f
+ dw DexRatingText_Own60To69
db 80
- dw PokedexRatingText_44224
+ dw DexRatingText_Own70To79
db 90
- dw PokedexRatingText_44229
+ dw DexRatingText_Own80To89
db 100
- dw PokedexRatingText_4422e
+ dw DexRatingText_Own90To99
db 110
- dw PokedexRatingText_44233
+ dw DexRatingText_Own100To109
db 120
- dw PokedexRatingText_44238
+ dw DexRatingText_Own110To119
db 130
- dw PokedexRatingText_4423d
+ dw DexRatingText_Own120To129
db 140
- dw PokedexRatingText_44242
+ dw DexRatingText_Own130To139
db 150
- dw PokedexRatingText_44247
+ dw DexRatingText_Own140To149
db NUM_POKEMON + 1
- dw PokedexRatingText_4424c
+ dw DexRatingText_Own150To151
-PokedexRatingText_44201:
- TX_FAR _OaksLabText_44201
+DexRatingText_Own0To9:
+ TX_FAR _DexRatingText_Own0To9
db "@"
-PokedexRatingText_44206:
- TX_FAR _OaksLabText_44206
+DexRatingText_Own10To19:
+ TX_FAR _DexRatingText_Own10To19
db "@"
-PokedexRatingText_4420b:
- TX_FAR _OaksLabText_4420b
+DexRatingText_Own20To29:
+ TX_FAR _DexRatingText_Own20To29
db "@"
-PokedexRatingText_44210:
- TX_FAR _OaksLabText_44210
+DexRatingText_Own30To39:
+ TX_FAR _DexRatingText_Own30To39
db "@"
-PokedexRatingText_44215:
- TX_FAR _OaksLabText_44215
+DexRatingText_Own40To49:
+ TX_FAR _DexRatingText_Own40To49
db "@"
-PokedexRatingText_4421a:
- TX_FAR _OaksLabText_4421a
+DexRatingText_Own50To59:
+ TX_FAR _DexRatingText_Own50To59
db "@"
-PokedexRatingText_4421f:
- TX_FAR _OaksLabText_4421f
+DexRatingText_Own60To69:
+ TX_FAR _DexRatingText_Own60To69
db "@"
-PokedexRatingText_44224:
- TX_FAR _OaksLabText_44224
+DexRatingText_Own70To79:
+ TX_FAR _DexRatingText_Own70To79
db "@"
-PokedexRatingText_44229:
- TX_FAR _OaksLabText_44229
+DexRatingText_Own80To89:
+ TX_FAR _DexRatingText_Own80To89
db "@"
-PokedexRatingText_4422e:
- TX_FAR _OaksLabText_4422e
+DexRatingText_Own90To99:
+ TX_FAR _DexRatingText_Own90To99
db "@"
-PokedexRatingText_44233:
- TX_FAR _OaksLabText_44233
+DexRatingText_Own100To109:
+ TX_FAR _DexRatingText_Own100To109
db "@"
-PokedexRatingText_44238:
- TX_FAR _OaksLabText_44238
+DexRatingText_Own110To119:
+ TX_FAR _DexRatingText_Own110To119
db "@"
-PokedexRatingText_4423d:
- TX_FAR _OaksLabText_4423d
+DexRatingText_Own120To129:
+ TX_FAR _DexRatingText_Own120To129
db "@"
-PokedexRatingText_44242:
- TX_FAR _OaksLabText_44242
+DexRatingText_Own130To139:
+ TX_FAR _DexRatingText_Own130To139
db "@"
-PokedexRatingText_44247:
- TX_FAR _OaksLabText_44247
+DexRatingText_Own140To149:
+ TX_FAR _DexRatingText_Own140To149
db "@"
-PokedexRatingText_4424c:
- TX_FAR _OaksLabText_4424c
+DexRatingText_Own150To151:
+ TX_FAR _DexRatingText_Own150To151
db "@"
diff --git a/engine/predefs.asm b/engine/predefs.asm
index 6f605043..cc6af5ac 100755
--- a/engine/predefs.asm
+++ b/engine/predefs.asm
@@ -1,8 +1,8 @@
GetPredefPointer:
-; Store the contents of the register
-; pairs (hl, de, bc) at wPredefRegisters.
-; Then put the bank and address of predef
-; wPredefID in [wPredefBank] and hl.
+ ; Store the contents of the register
+ ; pairs (hl, de, bc) at wPredefRegisters.
+ ; Then put the bank and address of predef
+ ; wPredefID in [wPredefBank] and hl.
ld a, h
ld [wPredefRegisters], a
@@ -50,15 +50,16 @@ GetPredefPointer:
ret
PredefPointers::
-; these are pointers to ASM routines.
-; they appear to be used in overworld map scripts.
+ ; these are pointers to ASM routines.
+ ; they appear to be used in overworld map scripts.
+ const_def
add_predef DrawPlayerHUDAndHPBar
add_predef CopyUncompressedPicToTilemap
add_predef AnimateSendingOutMon
add_predef ScaleSpriteByTwo
add_predef LoadMonBackPic
add_predef CopyDownscaledMonTiles
- dbw $03,JumpMoveEffect ; wrong bank
+ add_predef Func_f0a7
add_predef HealParty
add_predef MoveAnimation
add_predef DivideBCDPredef
@@ -81,8 +82,12 @@ PredefPointers::
add_predef LearnMoveFromLevelUp
add_predef LearnMove
add_predef GetQuantityOfItemInBag
- dbw $03,CheckForHiddenObjectOrBookshelfOrCardKeyDoor ; home bank
- dbw $03,GiveItem ; home bank
+
+ predef_const CheckForHiddenObjectOrBookshelfOrCardKeyDoor
+ predef_const GiveItem
+ dbw $03, CheckForHiddenObjectOrBookshelfOrCardKeyDoor ; home bank
+ dbw $03, GiveItem ; home bank
+
add_predef ChangeBGPalColor0_4Frames
add_predef FindPathToPlayer
add_predef PredefShakeScreenVertically
@@ -129,7 +134,7 @@ PredefPointers::
add_predef LoadTownMap_Nest
add_predef PrintMonType
add_predef EmotionBubble
- add_predef EmptyFunc3; return immediately
+ add_predef EmptyFunc3 ; return immediately
add_predef AskName
add_predef PewterGuys
add_predef SaveSAVtoSRAM2
@@ -139,6 +144,9 @@ PredefPointers::
add_predef DoInGameTradeDialogue
add_predef HallOfFamePC
add_predef DisplayDexRating
+
+ predef_const _LeaveMapAnim
+ predef_const EnterMapAnim
dbw $1E, _LeaveMapAnim ; wrong bank
dbw $1E, EnterMapAnim ; wrong bank
add_predef GetTileTwoStepsInFrontOfPlayer
diff --git a/engine/predefs7.asm b/engine/predefs7.asm
index 752bdd1a..bfa0ab57 100755
--- a/engine/predefs7.asm
+++ b/engine/predefs7.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/predefs12.asm b/engine/predefsA.asm
index 95f0ea25..e25735c5 100755..100644
--- a/engine/predefs12.asm
+++ b/engine/predefsA.asm
@@ -1,14 +1,16 @@
-; b = new colour for BG colour 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
ld a, [rBGP]
- or b
+ xor $ff
ld [rBGP], a
+ call UpdateGBCPal_BGP
ld c, 4
call DelayFrames
ld a, [rBGP]
- and %11111100
+ xor $ff
ld [rBGP], a
+ call UpdateGBCPal_BGP
ret
PredefShakeScreenVertically:
diff --git a/engine/print_waiting_text.asm b/engine/print_waiting_text.asm
index 7a95da2a..bd2180a1 100644
--- a/engine/print_waiting_text.asm
+++ b/engine/print_waiting_text.asm
@@ -1,15 +1,14 @@
PrintWaitingText:
coord hl, 3, 10
- ld b, $1
- ld c, $b
+ lb bc, 1, 11
ld a, [wIsInBattle]
and a
- jr z, .asm_4c17
+ jr z, .asm_4b9a
call TextBoxBorder
- jr .asm_4c1a
-.asm_4c17
+ jr .asm_4b9d
+.asm_4b9a
call CableClub_TextBoxBorder
-.asm_4c1a
+.asm_4b9d
coord hl, 4, 11
ld de, WaitingText
call PlaceString
diff --git a/engine/printer.asm b/engine/printer.asm
new file mode 100644
index 00000000..5be5286c
--- /dev/null
+++ b/engine/printer.asm
@@ -0,0 +1,999 @@
+ 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
+
+INCLUDE "engine/printer/serial.asm"
+
+PrintPokedexEntry:
+ ld a, [wUpdateSpritesEnabled]
+ push af
+ xor a
+ ld [wUpdateSpritesEnabled], a
+ ld [hCanceledPrinting], a
+ call Printer_PlayPrinterMusic
+ ld a, [rIE]
+ push af
+ xor a
+ ld [rIF], a
+ ld a, $9
+ ld [rIE], a
+ xor a
+ ld [H_AUTOBGTRANSFERENABLED], 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
+ callab Pokedex_DrawInterface
+ callab Pokedex_PlacePokemonList
+ ld a, $1
+ ld [H_AUTOBGTRANSFERENABLED], 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
+ ld [H_AUTOBGTRANSFERENABLED], a
+ call Printer_PrepareDexEntryForPrinting
+ ld a, $7
+ call Printer_StartTransmission
+ ld a, $3
+ ld [wcae2], a
+ call Printer_CopyTileMapToPrinterTileBuffer
+ call LoadScreenTilesFromBuffer1
+ ld a, $1
+ ld [H_AUTOBGTRANSFERENABLED], a
+ call .TryPrintPage
+.finish_printing
+ xor a
+ ld [wPrinterConnectionOpen], a
+ ld [wPrinterOpcode], a
+ xor a
+ ld [rIF], a
+ pop af
+ ld [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:
+ callab 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
+ callab Pokedex_PrepareDexEntryForPrinting
+ ret
+
+PrintSurfingMinigameHighScore:
+ xor a
+ ld [hCanceledPrinting], a
+ call Printer_PlayPrinterMusic
+ call Printer_PrepareSurfingMinigameHighScoreTileMap
+ ld a, [rIE]
+ push af
+ xor a
+ ld [rIF], a
+ ld a, $9
+ ld [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
+ ld [rIF], a
+ pop af
+ ld [rIE], a
+ call ReloadMapAfterPrinter
+ call Printer_PlayMapMusic
+ ret
+
+PrintDiploma:
+ xor a
+ ld [hCanceledPrinting], a
+ call Printer_PlayPrinterMusic
+ call _DisplayDiploma
+ ld a, [rIE]
+ push af
+ xor a
+ ld [rIF], a
+ ld a, $9
+ ld [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
+ ld [H_AUTOBGTRANSFERENABLED], 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
+ ld [rIF], a
+ pop af
+ ld [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
+ ld [hCanceledPrinting], a
+ call Printer_PlayPrinterMusic
+ ld a, [rIE]
+ push af
+ xor a
+ ld [rIF], a
+ ld a, $9
+ ld [rIE], a
+ call SaveScreenTilesToBuffer1
+ xor a
+ ld [H_AUTOBGTRANSFERENABLED], 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
+ ld [H_AUTOBGTRANSFERENABLED], 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
+ ld [H_AUTOBGTRANSFERENABLED], 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
+ ld [H_AUTOBGTRANSFERENABLED], 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
+ ld [rIF], a
+ pop af
+ ld [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:
+ TX_FAR _NoPokemonText
+ db "@"
+
+PrintFanClubPortrait:
+ xor a
+ ld [hCanceledPrinting], a
+ call Printer_PlayPrinterMusic
+ call Printer_GetMonStats
+ ld a, [rIE]
+ push af
+ xor a
+ ld [rIF], a
+ ld a, $9
+ ld [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
+ ld [rIF], a
+ pop af
+ ld [rIE], a
+ call ReloadMapAfterPrinter
+ call Printer_PlayMapMusic
+ ret
+
+PrinterDebug:
+ push af
+ push bc
+ push de
+ push hl
+ call StopAllMusic
+ ld a, [rIE]
+ push af
+ xor a
+ ld [rIF], a
+ ld a, $9
+ ld [rIE], a
+ call StartTransmission_Send9Rows
+ ld a, $13
+ ld [wcae2], a
+ ld a, $1
+ ld [H_AUTOBGTRANSFERENABLED], 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
+ ld [rIF], a
+ pop af
+ ld [rIE], a
+ pop hl
+ pop de
+ pop bc
+ pop af
+ ret
+
+Printer_CheckPressingB:
+ ld 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
+ ld [rSB], a
+ ld a, $1
+ ld [rSC], a
+ ld a, $81
+ ld [rSC], a
+.wait_send_cancel
+ ld a, [wPrinterOpcode]
+ and a
+ jr nz, .wait_send_cancel
+.already_done
+ ld a, $1
+ ld [hCanceledPrinting], a
+ scf
+ ret
+
+Printer_CopyTileMapToPrinterTileBuffer:
+ coord hl, 0, 0
+ coord de, 0, 0, wPrinterTileBuffer
+ ld bc, SCREEN_HEIGHT * SCREEN_WIDTH
+ call CopyData
+ ret
+
+Printer_CopyTileMapFromPrinterTileBuffer:
+ coord hl, 0, 0, wPrinterTileBuffer
+ coord de, 0, 0
+ ld bc, SCREEN_HEIGHT * SCREEN_WIDTH
+ call CopyData
+ ret
+
+Printer_ResetJoypadHRAM:
+ xor a
+ ld [hJoyLast], a
+ ld [hJoyReleased], a
+ ld [hJoyPressed], a
+ ld [hJoyHeld], a
+ ld [hJoy5], a
+ ld [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
+ ld [H_AUTOBGTRANSFERENABLED], a
+ coord hl, 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]
+ coord hl, 1, 7
+ call PlaceString
+ coord hl, 2, 15
+ ld de, .PressBToCancel
+ call PlaceString
+ ld a, $1
+ ld [H_AUTOBGTRANSFERENABLED], 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
+ coord hl, 0, 0
+ call .PlaceRowAlternatingTiles
+ coord hl, 0, 17
+ call .PlaceRowAlternatingTiles
+ coord hl, 0, 0
+ call .PlaceColumnAlternatingTiles
+ coord hl, 19, 0
+ call .PlaceColumnAlternatingTiles
+ ld a, $4
+ coord hl, 0, 0
+ ld [hl], a
+ coord hl, 0, 17
+ ld [hl], a
+ coord hl, 19, 0
+ ld [hl], a
+ coord hl, 19, 17
+ ld [hl], a
+ ld de, .Tilemap1
+ coord hl, 10, 8
+ lb bc, 3, 8
+ call Diploma_Surfing_CopyBox
+ ld de, .Tilemap2
+ coord hl, 2, 11
+ lb bc, 6, 16
+ call Diploma_Surfing_CopyBox
+ ld de, .PikachusBeachString
+ coord hl, 3, 2
+ call PlaceString
+ ld de, .HiScoreString
+ coord hl, 9, 4
+ call PlaceString
+ ld de, .PointsString
+ coord hl, 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
+ coord hl, 2, 4
+ add hl, bc
+ call PlaceString
+ call CopySurfingMinigameScore
+ ld b, 8
+ call RunPaletteCommand
+ ld a, $1
+ ld [H_AUTOBGTRANSFERENABLED], 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
+ coord hl, 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_2.2bpp"
+SurfingPikachu2GraphicsEnd:
+
+PrintPCBox_DrawPage1:
+ xor a
+ ld [wBoxNumString], a
+ call ClearScreen
+ call PrintPCBox_PlaceHorizontalLines
+ coord hl, 0, 0
+ ld bc, 11 * SCREEN_WIDTH
+ ld a, " "
+ call FillMemory
+ call PrintPCBox_DrawLeftAndRightBorders
+ call PrintPCBox_DrawTopBorder
+ coord hl, 4, 4
+ ld de, .PokemonListString
+ call PlaceString
+ coord hl, 7, 6
+ ld de, .BoxString
+ call PlaceString
+ coord hl, 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
+ coord hl, 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
+ coord hl, 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
+ coord hl, 4, 0
+ ld de, wBoxSpecies + 9
+ ld c, 6
+ call PrintPCBox_PlaceBoxMonInfo
+ ret
+
+PrintPCBox_DrawPage4:
+ call ClearScreen
+ call PrintPCBox_PlaceHorizontalLines
+ call PrintPCBox_DrawLeftAndRightBorders
+ coord hl, 0, 15
+ call PrintPCBox_DrawBottomBorderAtHL
+ coord hl, 0, 16
+ ld bc, 2 * SCREEN_WIDTH
+ ld a, " "
+ call FillMemory
+ ld a, [wBoxDataStart]
+ cp 16
+ ret c
+ coord hl, 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:
+ coord hl, 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:
+ coord hl, 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:
+ coord hl, 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:
+ coord hl, 4, 0
+ ld c, 6
+ call .PlaceHorizontalLine
+ coord hl, 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/serial.asm b/engine/printer/serial.asm
new file mode 100755
index 00000000..fa83eb9d
--- /dev/null
+++ b/engine/printer/serial.asm
@@ -0,0 +1,621 @@
+StartTransmission_Send9Rows:
+ ld a, 9
+Printer_StartTransmission:
+ push af
+ ld hl, wPrinterData
+ ld bc, wPrinterDataEnd - wPrinterData
+ xor a
+ call Printer_FillMemory
+ xor a
+ ld [rSB], a
+ ld [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, (wPrinterSendDataSource1End - wPrinterSendDataSource1) % $100
+ ld [wPrinterDataSize], a
+ ld a, (wPrinterSendDataSource1End - wPrinterSendDataSource1) / $100
+ 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
+ ld [rSB], a
+ ld a, $1
+ ld [rSC], a
+ ld a, $81
+ ld [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:
+ ld a, [rSB]
+ ld [wPrinterHandshake], a
+ ld a, $0
+ call .SendByte
+ call .NextInstruction
+ ret
+
+.Receive2:
+ ld 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:
+ ld [rSB], a
+ ld a, $1
+ ld [rSC], a
+ ld a, $81
+ ld [rSC], a
+ ret
+
+.Receive2_:
+ ld a, [rSB]
+ ld [wPrinterStatusFlags], a
+ xor a
+ ld [wPrinterOpcode], a
+ ret
diff --git a/engine/remove_pokemon.asm b/engine/remove_pokemon.asm
index 1fcb5d09..f29a428d 100644
--- a/engine/remove_pokemon.asm
+++ b/engine/remove_pokemon.asm
@@ -2,9 +2,9 @@ _RemovePokemon:
ld hl, wPartyCount
ld a, [wRemoveMonFromBox]
and a
- jr z, .asm_7b74
+ jr z, .usePartyCount
ld hl, wNumInBox
-.asm_7b74
+.usePartyCount
ld a, [hl]
dec a
ld [hli], a
@@ -15,28 +15,28 @@ _RemovePokemon:
ld e, l
ld d, h
inc de
-.asm_7b81
+.shiftMonSpeciesLoop
ld a, [de]
inc de
ld [hli], a
- inc a
- jr nz, .asm_7b81
+ inc a ; reached terminator?
+ jr nz, .shiftMonSpeciesLoop ; if not, continue shifting species
ld hl, wPartyMonOT
- ld d, $5
+ ld d, PARTY_LENGTH - 1 ; max number of pokemon to shift
ld a, [wRemoveMonFromBox]
and a
- jr z, .asm_7b97
+ jr z, .usePartyMonOTs
ld hl, wBoxMonOT
- ld d, $13
-.asm_7b97
+ ld d, MONS_PER_BOX - 1
+.usePartyMonOTs
ld a, [wWhichPokemon]
call SkipFixedLengthTextEntries
ld a, [wWhichPokemon]
- cp d
- jr nz, .asm_7ba6
- ld [hl], $ff
+ cp d ; are we removing the last pokemon?
+ jr nz, .notRemovingLastMon ; if not, shift the pokemon below
+ ld [hl], $ff ; else, write the terminator and return
ret
-.asm_7ba6
+.notRemovingLastMon
ld d, h
ld e, l
ld bc, NAME_LENGTH
@@ -44,41 +44,41 @@ _RemovePokemon:
ld bc, wPartyMonNicks
ld a, [wRemoveMonFromBox]
and a
- jr z, .asm_7bb8
+ jr z, .usePartyMonNicks
ld bc, wBoxMonNicks
-.asm_7bb8
+.usePartyMonNicks
call CopyDataUntil
ld hl, wPartyMons
ld bc, wPartyMon2 - wPartyMon1
ld a, [wRemoveMonFromBox]
and a
- jr z, .asm_7bcd
+ jr z, .usePartyMonStructs
ld hl, wBoxMons
ld bc, wBoxMon2 - wBoxMon1
-.asm_7bcd
+.usePartyMonStructs
ld a, [wWhichPokemon]
- call AddNTimes
- ld d, h
+ call AddNTimes ; get address of the pokemon removed
+ ld d, h ; store in de for CopyDataUntil
ld e, l
ld a, [wRemoveMonFromBox]
and a
- jr z, .asm_7be4
+ jr z, .copyUntilPartyMonOTs
ld bc, wBoxMon2 - wBoxMon1
- add hl, bc
- ld bc, wBoxMonOT
- jr .asm_7beb
-.asm_7be4
+ add hl, bc ; get address of pokemon after the pokemon removed
+ ld bc, wBoxMonOT ; address of when to stop copying
+ jr .continue
+.copyUntilPartyMonOTs
ld bc, wPartyMon2 - wPartyMon1
- add hl, bc
- ld bc, wPartyMonOT
-.asm_7beb
- call CopyDataUntil
+ add hl, bc ; get address of pokemon after the pokemon removed
+ ld bc, wPartyMonOT ; address of when to stop copying
+.continue
+ call CopyDataUntil ; shift all pokemon data after the removed mon to the removed mon's location
ld hl, wPartyMonNicks
ld a, [wRemoveMonFromBox]
and a
- jr z, .asm_7bfa
+ jr z, .usePartyMonNicks2
ld hl, wBoxMonNicks
-.asm_7bfa
+.usePartyMonNicks2
ld bc, NAME_LENGTH
ld a, [wWhichPokemon]
call AddNTimes
@@ -86,10 +86,10 @@ _RemovePokemon:
ld e, l
ld bc, NAME_LENGTH
add hl, bc
- ld bc, wPokedexOwned
+ ld bc, wPartyMonNicksEnd
ld a, [wRemoveMonFromBox]
and a
- jr z, .asm_7c15
+ jr z, .copyUntilPartyMonNicksEnd
ld bc, wBoxMonNicksEnd
-.asm_7c15
+.copyUntilPartyMonNicksEnd
jp CopyDataUntil
diff --git a/engine/save.asm b/engine/save.asm
index 97935dbb..7f453bf0 100755
--- a/engine/save.asm
+++ b/engine/save.asm
@@ -32,10 +32,8 @@ FileDataDestroyedText:
db "@"
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:
callba 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
- coord hl, 1, 13
- lb bc, 4, 18
- call ClearScreenArea
- coord hl, 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:
TX_FAR _WouldYouLikeToSaveText
db "@"
+SavingText:
+ TX_FAR _SavingText
+ db "@"
+
GameSavedText:
TX_FAR _GameSavedText
db "@"
@@ -196,10 +192,8 @@ OlderFileWillBeErasedText:
db "@"
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:
@@ -351,13 +342,16 @@ ChangeBox::
call z, EmptyAllSRAMBoxes ; if so, empty all boxes in SRAM
call DisplayChangeBoxMenu
call UpdateSprites
- ld hl, hFlags_0xFFF6
+ ld hl, hFlags_0xFFFA
set 1, [hl]
call HandleMenuInput
- ld hl, hFlags_0xFFF6
+ ld hl, hFlags_0xFFFA
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,21 +422,19 @@ DisplayChangeBoxMenu:
ld [wCurrentMenuItem], a
ld [wLastMenuItem], a
coord hl, 0, 0
- ld b, 2
- ld c, 9
+ lb bc, 2, 9
call TextBoxBorder
ld hl, ChooseABoxText
call PrintText
coord hl, 11, 0
- ld b, 12
- ld c, 7
+ lb bc, 12, 7
call TextBoxBorder
- ld hl, hFlags_0xFFF6
+ ld hl, hFlags_0xFFFA
set 2, [hl]
ld de, BoxNames
coord hl, 13, 1
call PlaceString
- ld hl, hFlags_0xFFF6
+ ld hl, hFlags_0xFFFA
res 2, [hl]
ld a, [wCurrentBoxNum]
and $7f
@@ -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 ($a598)
; and the two random numbers generated at game beginning
;(which are stored at wPlayerID)s
- ld a, $0a
- ld [MBC1SRamEnable], a
- ld a, $01
- ld [MBC1SRamBankingMode], a
+ call EnableSRAMAndLatchClockData
+ ld a, $1
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, $2000
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/slot_machine.asm b/engine/slot_machine.asm
index 3a46687f..b4514618 100755
--- a/engine/slot_machine.asm
+++ b/engine/slot_machine.asm
@@ -23,9 +23,11 @@ PromptUserToPlaySlots:
call LoadFontTilePatterns
ld b, SET_PAL_SLOTS
call RunPaletteCommand
+ call Delay3
call GBPalNormal
ld a, $e4
ld [rOBP0], a
+ call UpdateGBCPal_OBP0
ld hl, wd730
set 6, [hl]
xor a
@@ -80,8 +82,7 @@ MainSlotMachineLoop:
ld [wLastMenuItem], a
ld [wMenuWatchMovingOutOfBounds], a
coord hl, 14, 11
- ld b, 5
- ld c, 4
+ lb bc, 5, 4
call TextBoxBorder
coord hl, 16, 12
ld de, CoinMultiplierSlotMachineText
@@ -457,6 +458,7 @@ SlotMachine_CheckForMatches:
ld a, [rBGP]
xor $40
ld [rBGP], a
+ call UpdateGBCPal_BGP
ld c, 5
call DelayFrames
dec b
@@ -473,6 +475,7 @@ SlotMachine_CheckForMatches:
call SlotMachine_PrintPayoutCoins
ld a, $e4
ld [rOBP0], a
+ call UpdateGBCPal_OBP0
jp .done
SymbolLinedUpSlotMachineText:
@@ -698,6 +701,7 @@ SlotMachine_PayCoinsToPlayer:
ld a, [rOBP0]
xor $40 ; make the slot wheel symbols flash
ld [rOBP0], a
+ call UpdateGBCPal_OBP0
ld a, 5
.skip1
ld [wAnimCounter], a
@@ -852,17 +856,17 @@ LoadSlotMachineTiles:
ld de, vChars0
ld bc, $1c0
ld a, BANK(SlotMachineTiles2)
- call FarCopyData2
+ call FarCopyData
ld hl, SlotMachineTiles1
ld de, vChars2
ld bc, $250
ld a, BANK(SlotMachineTiles1)
- call FarCopyData2
+ call FarCopyData
ld hl, SlotMachineTiles2
ld de, vChars2 + $250
ld bc, $1c0
ld a, BANK(SlotMachineTiles2)
- call FarCopyData2
+ call FarCopyData
ld hl, SlotMachineMap
coord de, 0, 0
ld bc, SlotMachineMapEnd - SlotMachineMap
@@ -884,9 +888,4 @@ SlotMachineMapEnd:
INCLUDE "data/slot_machine_wheels.asm"
SlotMachineTiles1:
-IF DEF(_RED)
- INCBIN "gfx/red/slotmachine1.2bpp"
-ENDC
-IF DEF(_BLUE)
- INCBIN "gfx/blue/slotmachine1.2bpp"
-ENDC
+ INCBIN "gfx/slotmachine1.2bpp"
diff --git a/engine/surfing_minigame.asm b/engine/surfing_minigame.asm
new file mode 100755
index 00000000..81e5296d
--- /dev/null
+++ b/engine/surfing_minigame.asm
@@ -0,0 +1,2862 @@
+SurfingPikachuMinigame:
+ call SurfingPikachuMinigame_BlankPals
+ call DelayFrame
+ call DelayFrame
+ call DelayFrame
+ ld a, [hTilesetType]
+ push af
+ xor a
+ ld [hTilesetType], a
+ ld a, [wUpdateSpritesEnabled]
+ push af
+ ld a, $ff
+ ld [wUpdateSpritesEnabled], a
+ ld a, [rIE]
+ push af
+ xor a
+ ld [rIF], a
+ ld a, $f
+ ld [rIE], a
+ ld a, $8
+ ld [rSTAT], a
+ ld a, [H_AUTOBGTRANSFERDEST + 1]
+ push af
+ ld a, $98
+ ld [H_AUTOBGTRANSFERDEST + 1], a
+ call SurfingPikachuMinigameIntro
+ call SurfingPikachuLoop
+ xor a
+ ld [rBGP], a
+ ld [rOBP0], a
+ ld [rOBP1], a
+ call UpdateGBCPal_BGP
+ call UpdateGBCPal_OBP0
+ call UpdateGBCPal_OBP1
+ call ClearObjectAnimationBuffers
+ call ClearSprites
+ xor a
+ ld [hLCDCPointer], a
+ ld [hSCX], a
+ ld [hSCY], a
+ ld a, $90
+ ld [hWY], a
+ call DelayFrame
+ pop af
+ ld [H_AUTOBGTRANSFERDEST + 1], a
+ xor a
+ ld [rIF], a
+ pop af
+ ld [rIE], a
+ xor a
+ ld [rSTAT], a
+ call RunDefaultPaletteCommand
+ call ReloadMapAfterSurfingMinigame
+ call PlayDefaultMusic
+ call GBPalNormal
+ pop af
+ ld [wUpdateSpritesEnabled], a
+ pop af
+ ld [hTilesetType], 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
+ ld a, [hJoyPressed]
+ and SELECT
+ ret
+
+Func_f80b7:
+ ld 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
+ ld [H_AUTOBGTRANSFERENABLED], 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, SurfingPikachuSpawnStateDataPointer % $100
+ ld [wAnimatedObjectSpawnStateDataPointer], a
+ ld a, SurfingPikachuSpawnStateDataPointer / $100
+ ld [wAnimatedObjectSpawnStateDataPointer + 1], a
+
+ ld a, SurfingPikachuObjectJumptable % $100
+ ld [wAnimatedObjectJumptablePointer], a
+ ld a, SurfingPikachuObjectJumptable / $100
+ ld [wAnimatedObjectJumptablePointer + 1], a
+
+ ld a, SurfingPikachuOAMData % $100
+ ld [wAnimatedObjectOAMDataPointer], a
+ ld a, SurfingPikachuOAMData / $100
+ ld [wAnimatedObjectOAMDataPointer + 1], a
+
+ ld a, SurfingPikachuFrames % $100
+ ld [wAnimatedObjectFramesDataPointer], a
+ ld a, SurfingPikachuFrames / $100
+ ld [wAnimatedObjectFramesDataPointer + 1], a
+
+ ld hl, vBGMap0
+ ld bc, $800
+ ld a, $0
+ call FillMemory
+
+ ld hl, $98c0
+ ld bc, $180
+ 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
+ ld [hSCX], a
+ ld [hSCY], a
+ ld a, $7e
+ ld [hWY], a
+ ld a, rSCY - $ff00
+ ld [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
+ ld [rLCDC], a
+ call SurfingPikachuMinigame_SetBGPals
+ ld a, $e4
+ ld [rOBP0], a
+ ld a, $e0
+ ld [rOBP1], a
+ call UpdateGBCPal_OBP0
+ call UpdateGBCPal_OBP1
+ ret
+
+SurfingPikachuMinigame_SetBGPals:
+ ld a, [wOnSGB]
+ and a
+ jr nz, .sgb
+ ld a, $d0
+ ld [rBGP], a
+ call UpdateGBCPal_BGP
+ ret
+
+.sgb
+ ld a, $e4
+ ld [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
+ ld [hSCX], a
+ ld a, $72
+ ld [wSurfingMinigameWaveFunctionNumber], a
+ ld a, $4
+ ld [wc5d2], a
+ xor a
+ ld [hLCDCPointer], a
+ ld [wSurfingMinigameSCX], a
+ ld [wSurfingMinigameSCX + 1], a
+ ld [wSurfingMinigameSCX + 2], a
+ ret
+
+Func_f835c:
+ ld a, [hSCX]
+ and a
+ jr z, .asm_f837b
+ call SurfingMinigame_UpdateLYOverrides
+ call SurfingMinigame_SetPikachuHeight
+ call SurfingMinigame_ReadBGMapBuffer
+ ld a, [hSCX]
+ dec a
+ dec a
+ dec a
+ dec a
+ ld [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
+ ld 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
+ ld 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_LAND
+ 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_CRASH
+ 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:
+ ld 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:
+ ld 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:
+ ld 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
+ ld a, [hSCX]
+ and $7
+ ld e, a
+ ld a, [hl]
+ sub e
+ ret
+
+.seven
+ ld 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] ; ???
+ ld 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
+ ld [H_VBCOPYDEST], a
+ ld a, d
+ ld [H_VBCOPYDEST + 1], a
+ ld a, l
+ ld [H_VBCOPYSRC], a
+ ld a, h
+ ld [H_VBCOPYSRC + 1], a
+ ld a, 16 / $10
+ ld [H_VBCOPYSIZE], a
+ ret
+
+SurfingMinigame_SetPikachuHeight:
+ ld 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
+ ld a, [hSCX]
+ and $7
+ ld e, a
+ ld a, [hl]
+ sub e
+ ld [wSurfingMinigamePikachuObjectHeight], a
+ ret
+
+.asm_f88db
+ ld 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
+ coord de, 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
+ ld [H_AUTOBGTRANSFERENABLED], a
+ ret
+
+.BeachTilemap:
+INCBIN "gfx/unknown_f8946.map"
+.BeachTilemapEnd:
+
+.PlaceTextbox:
+ coord hl, 1, 1
+ lb de, $3b, $3c
+ ld a, $40
+ call .place_row
+ coord hl, 1, 2
+ lb de, $3f, $3f
+ ld a, $ff
+ call .place_row
+ coord hl, 1, 3
+ lb de, $3f, $3f
+ ld a, $ff
+ call .place_row
+ coord hl, 1, 4
+ lb de, $3f, $3f
+ ld a, $ff
+ call .place_row
+ coord hl, 1, 5
+ lb de, $3f, $3f
+ ld a, $ff
+ call .place_row
+ coord hl, 1, 6
+ lb de, $3f, $3f
+ ld a, $ff
+ call .place_row
+ coord hl, 1, 7
+ lb de, $3f, $3f
+ ld a, $ff
+ call .place_row
+ coord hl, 1, 8
+ lb de, $3f, $3f
+ ld a, $ff
+ call .place_row
+ coord hl, 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
+ coord de, 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
+ coord de, 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_SURFING_ADD_POINTS
+ call PlaySound
+ and a
+ ret
+
+.dead
+ pop bc
+ scf
+ ret
+
+SurfingMinigame_BCDPrintHPLeft:
+ coord hl, 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
+ coord de, 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_SURFING_ADD_POINTS
+ call PlaySound
+ and a
+ ret
+
+.done
+ pop bc
+ scf
+ ret
+
+SurfingMinigame_BCDPrintRadness:
+ ld a, [wSurfingMinigameRadnessScore + 1]
+ coord hl, 10, 4
+ call SurfingPikachu_PlaceBCDNumber
+ ld a, [wSurfingMinigameRadnessScore]
+ coord hl, 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]
+ coord hl, 10, 6
+ call SurfingPikachu_PlaceBCDNumber
+ ld a, [wSurfingMinigameTotalScore]
+ coord hl, 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
+ coord de, 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
+ callab IsSurfingPikachuInThePlayersParty
+ pop de
+ ret nc
+ callab 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
+ ld 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
+ ld [hSCX], a
+ jr SurfingMinigame_GenerateBGMap
+
+SurfingMinigame_ScrollAndGenerateBGMap:
+ ld a, $a0
+ ld [wSurfingMinigameXOffset], a
+ ld 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
+ ld [hSCX], a
+SurfingMinigame_GenerateBGMap:
+ ld hl, wSurfingMinigameSCX + 1
+ ld a, [hSCX]
+ cp [hl]
+ ret z
+ ld [hl], a
+ and $f0
+ ld hl, wSurfingMinigameSCX + 2
+ 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
+ ld 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
+ ld [hRedrawRowOrColumnDest], a
+ ld a, h
+ ld [hRedrawRowOrColumnDest + 1], a
+ ld a, $1
+ ld [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
+ ld [H_AUTOBGTRANSFERENABLED], a
+ call ClearObjectAnimationBuffers
+ ld hl, SurfingPikachu1Graphics3
+ ld de, $8800
+ ld bc, $900
+ ld a, BANK(SurfingPikachu1Graphics3)
+ call FarCopyData
+ ld a, SurfingPikachuSpawnStateDataPointer % $100
+ ld [wAnimatedObjectSpawnStateDataPointer], a
+ ld a, SurfingPikachuSpawnStateDataPointer / $100
+ ld [wAnimatedObjectSpawnStateDataPointer + 1], a
+ ld a, SurfingPikachuObjectJumptable % $100
+ ld [wAnimatedObjectJumptablePointer], a
+ ld a, SurfingPikachuObjectJumptable / $100
+ ld [wAnimatedObjectJumptablePointer + 1], a
+ ld a, SurfingPikachuOAMData % $100
+ ld [wAnimatedObjectOAMDataPointer], a
+ ld a, SurfingPikachuOAMData / $100
+ ld [wAnimatedObjectOAMDataPointer + 1], a
+ ld a, SurfingPikachuFrames % $100
+ ld [wAnimatedObjectFramesDataPointer], a
+ ld a, SurfingPikachuFrames / $100
+ ld [wAnimatedObjectFramesDataPointer + 1], a
+ ld a, $c
+ lb de, $74, $58
+ call SpawnAnimatedObject
+ call DrawSurfingPikachuMinigameIntroBackground
+ xor a
+ ld [hSCX], a
+ ld [hSCY], a
+ ld a, $90
+ ld [hWY], a
+ ld b, $f
+ call RunPaletteCommand
+ ld a, $e3
+ ld [rLCDC], a
+ ld a, $1
+ ld [H_AUTOBGTRANSFERENABLED], a
+ call DelayFrame
+ call DelayFrame
+ call DelayFrame
+ call SurfingPikachuMinigame_SetBGPals
+ ld a, $e4
+ ld [rOBP0], a
+ ld a, $e0
+ ld [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
+ coord de, 0, 6
+ ld bc, 12 * SCREEN_WIDTH
+ call CopyData
+ ld de, Tilemap_f91c8
+ coord hl, 4, 0
+ lb bc, 6, 12
+ call .CopyBox
+ coord hl, 3, 7
+ lb bc, 3, 15
+ call .FillBoxWithFF
+ ld hl, Tilemap_f91ac
+ coord de, 3, 7
+ ld bc, 15
+ call CopyData
+ ld hl, Tilemap_f91bb
+ coord de, 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/unknown_f90bc.map"
+Tilemap_f91ac: INCBIN "gfx/unknown_f91ac.map"
+Tilemap_f91bb: INCBIN "gfx/unknown_f91bb.map"
+Tilemap_f91c8: INCBIN "gfx/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
+ ld a, [H_FRAMECOUNTER]
+ and a
+ jr nz, .delayed
+ ld a, [hJoyHeld]
+ ld [hJoy5], a
+ ld a, $2
+ ld [H_FRAMECOUNTER], a
+ ret
+
+.delayed
+ xor a
+ ld [hJoy5], a
+ ret
+
+SurfingPikachuMinigame_BlankPals:
+ xor a
+ ld [rBGP], a
+ ld [rOBP0], a
+ ld [rOBP1], a
+ call UpdateGBCPal_BGP
+ call UpdateGBCPal_OBP0
+ call UpdateGBCPal_OBP1
+ ret
+
+SurfingPikachuMinigame_NormalPals:
+ ld a, $e4
+ ld [rBGP], a
+ ld [rOBP0], a
+ ld a, $e0
+ ld [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_wave $100
+
+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/animated_objects_3e_1.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/titlescreen.asm b/engine/titlescreen.asm
index 03a5832d..d4dd0fd3 100755
--- a/engine/titlescreen.asm
+++ b/engine/titlescreen.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,35 @@ DisplayTitleScreen:
call ClearScreen
call DisableLCD
call LoadFontTilePatterns
+; todo: fix hl pointers
ld hl, NintendoCopyrightLogoGraphics
- ld de, vTitleLogo2 + $100
+ ld de, vTitleLogo + $600
ld bc, $50
ld a, BANK(NintendoCopyrightLogoGraphics)
- call FarCopyData2
+ call FarCopyData
+ ld hl, NineTile
+ ld de, vTitleLogo + $6e0
+ ld bc, $10
+ ld a, BANK(NineTile)
+ call FarCopyData
ld hl, GamefreakLogoGraphics
- ld de, vTitleLogo2 + $100 + $50
- ld bc, $90
+ ld de, vTitleLogo + 101 * $10
+ ld bc, 9 * $10
ld a, BANK(GamefreakLogoGraphics)
- call FarCopyData2
- ld hl, PokemonLogoGraphics
- ld de, vTitleLogo
- ld bc, $600
- ld a, BANK(PokemonLogoGraphics)
- call FarCopyData2 ; first chunk
- ld hl, PokemonLogoGraphics+$600
- ld de, vTitleLogo2
- ld bc, $100
- ld a, BANK(PokemonLogoGraphics)
- call FarCopyData2 ; second chunk
- ld hl, Version_GFX
- ld de, vChars2 + $600 - (Version_GFXEnd - Version_GFX - $50)
- 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)
- coord hl, 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
- coord hl, 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
- coord hl, 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
+ callab LoadYellowTitleScreenGFX
+ ld hl, vBGMap0
+ ld bc, (vBGMap1 + $400) - vBGMap0
+ ld a, " "
+ call FillMemory
+ callab TitleScreen_PlacePokemonLogo
+ call FillSpriteBuffer0WithAA
+ call .WriteCopyrightTiles
call SaveScreenTilesToBuffer2
call LoadScreenTilesFromBuffer2
call EnableLCD
-IF DEF(_RED)
- ld a, CHARMANDER ; which Pokemon to show first on the title screen
-ENDC
-IF DEF(_BLUE)
- ld a, SQUIRTLE ; which Pokemon to show first on the title screen
-ENDC
-
- ld [wTitleMonSpecies], a
- call LoadTitleMonSprite
- ld a, (vBGMap0 + $300) / $100
+ callab TitleScreen_PlacePikachu
+ ld a, $9b
call TitleScreenCopyTileMapToVRAM
call SaveScreenTilesToBuffer1
ld a, $40
@@ -137,8 +69,9 @@ ENDC
ld b, SET_PAL_TITLE_SCREEN
call RunPaletteCommand
call GBPalNormal
- ld a, %11100100
+ ld a, %11100000
ld [rOBP0], a
+ call UpdateGBCPal_OBP0
; make pokemon logo bounce up and down
ld bc, hSCY ; background scroll Y
@@ -180,6 +113,21 @@ ENDC
jr nz, .ScrollTitleScreenPokemonLogo
ret
+; place tiles for title screen copyright
+.WriteCopyrightTiles
+ coord hl, 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
@@ -188,52 +136,42 @@ ENDC
call PlaySound
; scroll game version in from the right
- call PrintGameVersionOnTitleScreen
+ callab TitleScreen_PlacePikaSpeechBubble
ld a, SCREEN_HEIGHT_PIXELS
ld [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, vBGMap1 / $100
- 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
-
-; 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
- callba TitleScreenAnimateBallIfStarterOut
- call TitleScreenPickNewMon
- jr .awaitUserInterruptionLoop
-
-.finishedWaiting
- ld a, [wTitleMonSpecies]
- call PlayCry
- call WaitForSoundToFinish
+ 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
+ ld a, [hJoyHeld]
+ cp D_UP | SELECT | B_BUTTON
+ jr z, .go_to_main_menu
+ and A_BUTTON | START
+ jr nz, .go_to_main_menu
+ call DoTitleScreenFunction
+ jr .titleScreenLoop
+
+.go_to_main_menu
+ ld e, $a
+ call TitleScreen_PlayPikachuPCM
call GBPalWhiteOutWithDelay3
call ClearSprites
xor a
@@ -254,108 +192,39 @@ ENDC
jp z, .doClearSaveDialogue
jp MainMenu
-.doClearSaveDialogue
- jpba DoClearSaveDialogue
-
-TitleScreenPickNewMon:
- ld a, vBGMap0 / $100
- 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
- ld [hWY], a
- ld d, 1 ; scroll out
- callba TitleScroll
- ret
-
-TitleScreenScrollInMon:
- ld d, 0 ; scroll in
- callba TitleScroll
- xor a
- ld [hWY], a
- ret
-
-ScrollTitleScreenGameVersion:
-.wait
- ld a, [rLY]
- cp l
- jr nz, .wait
-
- ld a, h
- ld [rSCX], a
+.asm_42f0
+; unreferenced
+ callab PrinterDebug
+ jp .loop
-.wait2
- ld a, [rLY]
- cp h
- jr z, .wait2
- ret
-
-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
- ld de, $605a
- 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
+ callab 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
+ jpba DoClearSaveDialogue
-LoadTitleMonSprite:
- ld [wcf91], a
- ld [wd0b5], a
- coord hl, 5, 10
- call GetMonHeader
- jp LoadFrontSpriteByMonIndex
TitleScreenCopyTileMapToVRAM:
ld [H_AUTOBGTRANSFERDEST + 1], a
@@ -370,34 +239,132 @@ LoadCopyrightAndTextBoxTiles:
LoadCopyrightTiles:
ld de, NintendoCopyrightLogoGraphics
ld hl, vChars2 + $600
- 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
coord hl, 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/title_mons.asm"
-
-; prints version text (red, blue)
-PrintGameVersionOnTitleScreen:
- coord hl, 7, 8
- ld de, VersionOnTitleScreenText
- jp PlaceString
+TitleScreen_PlayPikachuPCM:
+ callab PlayPikachuSoundClip
+ ret
+
+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
+
+.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
-; 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
+; 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/titlescreen2.asm b/engine/titlescreen2.asm
index 2346fcc5..8b4bc4de 100755
--- a/engine/titlescreen2.asm
+++ b/engine/titlescreen2.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,7 +91,7 @@ TitleBallYTable:
TitleScreenAnimateBallIfStarterOut:
; Animate the TitleBall if a starter just got scrolled out.
- ld a, [wTitleMonSpecies]
+ ld a, [wTitleScreenScene]
cp STARTER1
jr z, .ok
cp STARTER2
diff --git a/engine/town_map.asm b/engine/town_map.asm
index d417e0a3..7d32b5fe 100755
--- a/engine/town_map.asm
+++ b/engine/town_map.asm
@@ -103,6 +103,13 @@ DisplayTownMap:
ld [wWhichTownMapLocation], a
jp .townMapLoop
+.asm_70f87
+ ld a,[hJoy5]
+ and D_DOWN | D_UP
+ ret z
+ callab PlayPikachuSoundClip
+ ret
+
INCLUDE "data/town_map_order.asm"
TownMapCursor:
@@ -137,11 +144,14 @@ MonsNestText:
LoadTownMap_Fly:
call ClearSprites
call LoadTownMap
+ ld a, $1
+ ld [hJoy7], a
call LoadPlayerSpriteGraphics
call LoadFontTilePatterns
ld de, BirdSprite
+ ld b, BANK(BirdSprite)
+ ld c, $c
ld hl, vSprites + $40
- lb bc, BANK(BirdSprite), $c
call CopyVideoData
ld de, TownMapUpArrow
ld hl, vChars1 + $6d0
@@ -179,7 +189,7 @@ LoadTownMap_Fly:
ld c, 15
call DelayFrames
coord hl, 18, 0
- ld [hl], "▲"
+ ld [hl], "▶"
coord hl, 19, 0
ld [hl], "▼"
pop hl
@@ -213,6 +223,7 @@ LoadTownMap_Fly:
.pressedB
xor a
ld [wTownMapSpriteBlinkingEnabled], a
+ ld [hJoy7], a
call GBPalWhiteOutWithDelay3
pop hl
pop af
@@ -279,15 +290,14 @@ LoadTownMap:
call ClearScreen
call UpdateSprites
coord hl, 0, 0
- ld b, $12
- ld c, $12
+ lb bc, $12, $12
call TextBoxBorder
call DisableLCD
ld hl, WorldMapTileGraphics
ld de, vChars2 + $600
ld bc, WorldMapTileGraphicsEnd - WorldMapTileGraphics
ld a, BANK(WorldMapTileGraphics)
- call FarCopyData2
+ call FarCopyData
ld hl, MonNestIcon
ld de, vSprites + $40
ld bc, MonNestIconEnd - MonNestIcon
@@ -397,8 +407,7 @@ DisplayWildLocations:
jr nz, .drawPlayerSprite
; if no OAM entries were written, print area unknown text
coord hl, 1, 7
- ld b, 2
- ld c, 15
+ lb bc, 2, 15
call TextBoxBorder
coord hl, 2, 9
ld de, AreaUnknownText
diff --git a/engine/trade.asm b/engine/trade.asm
index 8bc8e3bc..e4bc0768 100755
--- a/engine/trade.asm
+++ b/engine/trade.asm
@@ -20,12 +20,13 @@ ExternalClockTradeAnim:
TradeAnimCommon:
ld a, [wOptions]
push af
+ and %110000 ; preserve speaker options
+ ld [wOptions], a
ld a, [hSCY]
push af
ld a, [hSCX]
push af
xor a
- ld [wOptions], a
ld [hSCY], a
ld [hSCX], a
push de
@@ -160,12 +161,12 @@ LoadTradingGFXAndMonNames:
ld de, vChars2 + $310
ld bc, TradingAnimationGraphicsEnd - TradingAnimationGraphics
ld a, BANK(TradingAnimationGraphics)
- call FarCopyData2
+ call FarCopyData
ld hl, TradingAnimationGraphics2
ld de, vSprites + $7c0
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
ld [rOBP0], a
+ call UpdateGBCPal_OBP0
call EnableLCD
xor a
ld [H_AUTOBGTRANSFERENABLED], a
@@ -199,6 +201,7 @@ LoadTradingGFXAndMonNames:
Trade_LoadMonPartySpriteGfx:
ld a, %11010000
ld [rOBP1], a
+ call UpdateGBCPal_OBP1
jpba LoadMonPartySpriteGfx
Trade_SwapNames:
@@ -233,8 +236,7 @@ Trade_ShowPlayerMon:
xor a
ld [H_AUTOBGTRANSFERENABLED], a
coord hl, 4, 0
- ld b, 6
- ld c, 10
+ lb bc, 6, 10
call TextBoxBorder
call Trade_PrintPlayerMonInfoText
ld b, vBGMap0 / $100
@@ -303,6 +305,7 @@ Trade_AnimateBallEnteringLinkCable:
call DelayFrames
ld a, %11100100
ld [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
coord hl, 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
ld [rOBP0], a
+ call UpdateGBCPal_OBP0
ld a, $54
ld [wBaseCoordX], a
ld a, $1c
@@ -446,6 +449,8 @@ Trade_InitGameboyTransferGfx:
ld a, $1
ld [H_AUTOBGTRANSFERENABLED], a
call ClearScreen
+ ld b, SET_PAL_GENERIC
+ call RunPaletteCommand
xor a
ld [H_AUTOBGTRANSFERENABLED], a
call Trade_LoadMonPartySpriteGfx
@@ -479,8 +484,7 @@ Trade_DrawLeftGameboy:
; draw text box with player name below gameboy pic
coord hl, 4, 12
- ld b, 2
- ld c, 7
+ lb bc, 2, 7
call TextBoxBorder
coord hl, 5, 14
ld de, wPlayerName
@@ -526,8 +530,7 @@ Trade_DrawRightGameboy:
; draw text box with enemy name above link cable
coord hl, 6, 0
- ld b, 2
- ld c, 7
+ lb bc, 2, 7
call TextBoxBorder
coord hl, 7, 2
ld de, wLinkEnemyTrainerName
@@ -599,6 +602,7 @@ Trade_AnimCircledMon:
ld a, [rBGP]
xor $3c ; make link cable flash
ld [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/turn_sprite.asm b/engine/turn_sprite.asm
deleted file mode 100755
index e8a47a8f..00000000
--- a/engine/turn_sprite.asm
+++ /dev/null
@@ -1,25 +0,0 @@
-UpdateSpriteFacingOffsetAndDelayMovement:
- ld h, $c2
- ld a, [H_CURRENTSPRITEOFFSET]
- add $8
- ld l, a
- ld a, $7f ; maximum movement delay
- ld [hl], a ; c2x8 (movement delay)
- dec h
- ld a, [H_CURRENTSPRITEOFFSET]
- add $9
- ld l, a
- ld a, [hld] ; c1x9 (facing direction)
- ld b, a
- xor a
- ld [hld], a
- ld [hl], a ; c1x8 (walk animation frame)
- ld a, [H_CURRENTSPRITEOFFSET]
- add $2
- ld l, a
- ld a, [hl] ; c1x2 (facing and animation table offset)
- or b ; or in the facing direction
- ld [hld], a
- ld a, $2 ; delayed movement status
- ld [hl], a ; c1x1 (movement status)
- ret
diff --git a/engine/unknown_ea3ea.asm b/engine/unknown_ea3ea.asm
new file mode 100755
index 00000000..1908809b
--- /dev/null
+++ b/engine/unknown_ea3ea.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
+ ld [H_AUTOBGTRANSFERENABLED], a
+ xor a
+ ld [wWhichTradeMonSelectionMenu], a
+ call LoadMonData
+
+ ld hl, wTileMap
+ lb bc, 16, 18
+ call TextBoxBorder
+
+ coord hl, 0, 12
+ lb bc, 4, 18
+ call TextBoxBorder
+
+ coord hl, 3, 10
+ call PrintLevelFull
+
+ coord hl, 2, 10
+ ld a, $6e
+ ld [hli], a
+ ld [hl], " "
+
+ coord hl, 2, 11
+ ld [hl], "′"
+
+ coord hl, 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
+ coord hl, 8, 2
+ call PlaceString
+
+ call GetMonName
+ coord hl, 9, 3
+ call PlaceString
+
+ predef IndexToPokedex
+ coord hl, 2, 8
+ ld [hl], "№"
+ inc hl
+ ld [hl], $f2
+ inc hl
+ ld de, wPokeBallAnimData
+ lb bc, $80 | 1, 3
+ call PrintNumber
+
+ coord hl, 8, 4
+ ld de, .OT
+ call PlaceString
+
+ ld hl, wPartyMonOT
+ call .GetNamePointer
+ coord hl, 9, 5
+ call PlaceString
+
+ coord hl, 9, 6
+ ld de, .IDNo
+ call PlaceString
+
+ coord hl, 13, 6
+ ld de, wLoadedMonOTID
+ lb bc, $80 | 2, 5
+ call PrintNumber
+
+ coord hl, 9, 8
+ ld de, .Stats
+ ld a, [hFlags_0xFFFA]
+ set 2, a
+ ld [hFlags_0xFFFA], a
+ call PlaceString
+ ld a, [hFlags_0xFFFA]
+ res 2, a
+ ld [hFlags_0xFFFA], a
+
+ coord hl, 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
+
+ coord hl, 1, 13
+ ld a, [wLoadedMonMoves]
+ call .PlaceMoveName
+
+ coord hl, 1, 14
+ ld a, [wLoadedMonMoves + 1]
+ call .PlaceMoveName
+
+ coord hl, 1, 15
+ ld a, [wLoadedMonMoves + 2]
+ call .PlaceMoveName
+
+ coord hl, 1, 16
+ ld a, [wLoadedMonMoves + 3]
+ call .PlaceMoveName
+
+ ld b, $4 ; SET_PAL_STATUS_SCREEN
+ call RunPaletteCommand
+
+ ld a, $1
+ ld [H_AUTOBGTRANSFERENABLED], a
+ call Delay3
+ call GBPalNormal
+ coord hl, 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/stats_screen_hp.1bpp"
+GFX_ea563End:
+
+GFX_ea56b:
+INCBIN "gfx/stats_screen_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/zero_one_ea597.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 a, $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 a, $ff
+ jr nz, .asm_ea6e4
+ ld a, [wPrinterStatusFlags]
+ cp a, $ff
+ jr z, .asm_ea6fb
+.asm_ea6e4
+ ld a, [wPrinterHandshake]
+ cp a, $81
+ jr nz, .asm_ea6fb
+ ld a, [wPrinterStatusFlags]
+ cp a, $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
+ ld [rSB], a
+ ld a, $1
+ ld [rSC], a
+ ld a, $81
+ ld [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:
+ ld a, [rOBP0]
+ and $3
+ ret
+
+.Pal2:
+ ld a, [rOBP0]
+ and $c
+ srl a
+ srl a
+ ret
+
+.Pal1:
+ ld a, [rOBP0]
+ and $30
+ swap a
+ ret
+
+.Pal3:
+ ld 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/vermilion_gym_trash_cans.asm b/engine/vermilion_gym_trash_cans.asm
new file mode 100755
index 00000000..49dee50c
--- /dev/null
+++ b/engine/vermilion_gym_trash_cans.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]
+ ld [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/yellow_intro.asm b/engine/yellow_intro.asm
new file mode 100755
index 00000000..9c9e26b3
--- /dev/null
+++ b/engine/yellow_intro.asm
@@ -0,0 +1,1081 @@
+PlayIntroScene:
+ ld a, [rIE]
+ push af
+ xor a
+ ld [rIF], a
+ ld a, $f
+ ld [rIE], a
+ ld a, $8
+ ld [rSTAT], a
+ call InitYellowIntroGFXAndMusic
+ call DelayFrame
+.loop
+ ld a, [wYellowIntroCurrentScene]
+ bit 7, a
+ jr nz, .go_to_title_screen
+ call JoypadLowSensitivity
+ ld 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
+ ld [hLCDCPointer], a
+ call DelayFrame
+ xor a
+ ld [rIF], a
+ pop af
+ ld [rIE], a
+ ld a, $90
+ ld [hWY], a
+ call ClearObjectAnimationBuffers
+ ld hl, wTileMap
+ ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
+ xor a
+ call Bank3E_FillMemory
+ call YellowIntro_BlankOAMBuffer
+ ld a, $1
+ ld [H_AUTOBGTRANSFERENABLED], a
+ call DelayFrame
+ call DelayFrame
+ call DelayFrame
+ xor a
+ ld [H_AUTOBGTRANSFERENABLED], 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
+ ld [hLCDCPointer], a
+ lb de, $58, $58
+ ld a, $1
+ call YellowIntro_SpawnAnimatedObjectAndSavePointer
+ xor a
+ ld [hSCX], a
+ ld [hSCY], a
+ ld a, $90
+ ld [hWY], a
+ ld a, $e4
+ ld [rBGP], a
+ ld [rOBP0], a
+ ld a, $c4
+ ld [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
+ ld [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
+ ld 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
+ ld [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
+ ld [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
+ ld a, [hSCX]
+ cp $68
+ ret z
+ add $4
+ ld [hSCX], a
+ ret
+
+.expired
+ call MaskAllAnimatedObjectStructs
+ call YellowIntro_NextScene
+ ret
+
+YellowIntroScene4:
+ call YellowIntro_BlankPalsDelay2AndDisableLCD
+ ld c, $5
+ call UpdateMusicCTimes
+ ld 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
+ ld [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
+ ld [rVBK], a
+.dmg_sgb
+ xor a
+ ld [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, rSCY - $ff00
+ ld [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
+ ld [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
+ ld [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/unknown_f9b6e.map"
+Unkn_f9be6: INCBIN "gfx/unknown_f9be6.map"
+Unkn_f9bf2: INCBIN "gfx/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, YellowIntroCloudGFX1
+ add hl, de
+ ld a, l
+ ld [H_VBCOPYSRC], a
+ ld a, h
+ ld [H_VBCOPYSRC + 1], a
+ xor a
+ ld [H_VBCOPYDEST], a
+ ld a, $96
+ ld [H_VBCOPYDEST + 1], a
+ ld a, $4
+ ld [H_VBCOPYSIZE], a
+ ret
+
+.expired
+ call YellowIntro_MaskCurrentAnimatedObjectStruct
+ call YellowIntro_NextScene
+ ret
+
+YellowIntroCloudGFX1: INCBIN "gfx/unknown_f9c2c.2bpp"
+YellowIntroCloudGFX2: INCBIN "gfx/unknown_f9c6c.2bpp" ; indirectly referenced
+
+YellowIntroScene12:
+ call YellowIntro_BlankPalsDelay2AndDisableLCD
+ ld c, $5
+ call UpdateMusicCTimes
+ xor a
+ ld [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
+ ld [rBGP], a
+ ld [rOBP0], a
+ and $f0
+ ld [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
+ coord hl, 0, 4
+ ld bc, CopyVideoDataAlternate
+ xor a
+ call Bank3E_FillMemory
+ coord hl, 0, 14
+ ld bc, $50
+ ld a, $1
+ call Bank3E_FillMemory
+ ld a, $1
+ ld [H_AUTOBGTRANSFERENABLED], a
+ call DelayFrame
+ call DelayFrame
+ call DelayFrame
+ xor a
+ ld [H_AUTOBGTRANSFERENABLED], a
+ ld a, $e4
+ ld [rOBP0], a
+ ld [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
+ ld a, [rOBP0]
+ xor $ff
+ ld [rOBP0], a
+ ld a, [rBGP]
+ xor $3
+ ld [rBGP], a
+ call UpdateGBCPal_BGP
+ call UpdateGBCPal_OBP0
+ ret
+
+.expired
+ xor a
+ ld [hLCDCPointer], a
+ ld a, $e4
+ ld [rBGP], a
+ ld [rOBP0], a
+ call UpdateGBCPal_BGP
+ call UpdateGBCPal_OBP0
+ call YellowIntro_NextScene
+YellowIntroScene16:
+ ld de, YellowIntroPalSequence_f9e0a
+ call YellowIntro_LoadDMGPalAndIncrementCounter
+ jr c, .expired
+ ld [rOBP0], a
+ ld [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
+ ld [rBGP], a
+ ld [rOBP0], a
+ ld [rOBP1], a
+ call UpdateGBCPal_BGP
+ call UpdateGBCPal_OBP0
+ call UpdateGBCPal_OBP1
+ call DelayFrame
+ call DelayFrame
+ call DisableLCD
+ ret
+
+Func_f9e9a:
+ ld e, a
+ callab YellowIntroPaletteAction
+ xor a
+ ld [hSCX], a
+ ld [hSCY], a
+ ld a, $90
+ ld [hWY], a
+ ld a, $e3
+ ld [rLCDC], a
+ ld a, $e4
+ ld [rBGP], a
+ ld [rOBP0], a
+ ld a, $e0
+ ld [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
+ ld [H_VBCOPYSRC], a
+ ld a, wLYOverridesBuffer / $100
+ ld [H_VBCOPYSRC + 1], a
+ ld a, $10
+ ld [H_VBCOPYDEST], a
+ ld a, wLYOverrides / $100
+ ld [H_VBCOPYDEST + 1], a
+ ld a, $7
+ ld [H_VBCOPYSIZE], a
+ ret
+
+InitYellowIntroGFXAndMusic:
+ xor a
+ ld [H_AUTOBGTRANSFERENABLED], a
+ ld [hSCX], a
+ ld [hSCY], a
+ ld [H_AUTOBGTRANSFERDEST], a
+ ld a, $98
+ ld [H_AUTOBGTRANSFERDEST + 1], a
+ call YellowIntro_BlankTileMap
+ ld hl, wTileMap
+ ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
+ ld a, $1
+ call Bank3E_FillMemory
+ coord hl, 0, 4
+ ld bc, CopyVideoDataAlternate
+ xor a
+ call Bank3E_FillMemory
+ ld a, $1
+ ld [H_AUTOBGTRANSFERENABLED], a
+ call DelayFrame
+ call DelayFrame
+ call DelayFrame
+ xor a
+ ld [H_AUTOBGTRANSFERENABLED], a
+ ld de, $6b5a
+ ld hl, $8000
+ ld bc, $3eff
+ call CopyVideoData
+ ld de, $635a
+ ld hl, $9000
+ ld bc, $3e80
+ 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, YellowIntro_AnimatedObjectSpawnStateData % $100
+ ld [wAnimatedObjectSpawnStateDataPointer], a
+ ld a, YellowIntro_AnimatedObjectSpawnStateData / $100
+ ld [wAnimatedObjectSpawnStateDataPointer + 1], a
+ ld a, YellowIntro_AnimatedObjectJumptable % $100
+ ld [wAnimatedObjectJumptablePointer], a
+ ld a, YellowIntro_AnimatedObjectJumptable / $100
+ ld [wAnimatedObjectJumptablePointer + 1], a
+ ld a, YellowIntro_AnimatedObjectOAMData % $100
+ ld [wAnimatedObjectOAMDataPointer], a
+ ld a, YellowIntro_AnimatedObjectOAMData / $100
+ ld [wAnimatedObjectOAMDataPointer + 1], a
+ ld a, YellowIntro_AnimatedObjectFramesData % $100
+ ld [wAnimatedObjectFramesDataPointer], a
+ ld a, YellowIntro_AnimatedObjectFramesData / $100
+ 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
+ ld [rBGP], a
+ ld [rOBP0], a
+ ld [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_wave $100
diff --git a/gfx/9_tile.png b/gfx/9_tile.png
new file mode 100644
index 00000000..e6fc8911
--- /dev/null
+++ b/gfx/9_tile.png
Binary files differ
diff --git a/gfx/badges.png b/gfx/badges.png
index 8b0fc516..46e7add3 100644
--- a/gfx/badges.png
+++ b/gfx/badges.png
Binary files differ
diff --git a/gfx/blocksets/beachhouse.bst b/gfx/blocksets/beachhouse.bst
new file mode 100644
index 00000000..bafbe0b2
--- /dev/null
+++ b/gfx/blocksets/beachhouse.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/plateau.bst b/gfx/blocksets/plateau.bst
index 26435dc8..54c3ffec 100644
--- a/gfx/blocksets/plateau.bst
+++ b/gfx/blocksets/plateau.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/blue/intro_purin_1.png b/gfx/blue/intro_purin_1.png
deleted file mode 100644
index 0e53582c..00000000
--- a/gfx/blue/intro_purin_1.png
+++ /dev/null
Binary files differ
diff --git a/gfx/blue/intro_purin_2.png b/gfx/blue/intro_purin_2.png
deleted file mode 100644
index 21107af0..00000000
--- a/gfx/blue/intro_purin_2.png
+++ /dev/null
Binary files differ
diff --git a/gfx/blue/intro_purin_3.png b/gfx/blue/intro_purin_3.png
deleted file mode 100644
index 1c30a0e8..00000000
--- a/gfx/blue/intro_purin_3.png
+++ /dev/null
Binary files differ
diff --git a/gfx/blue/sgbborder.map b/gfx/blue/sgbborder.map
deleted file mode 100644
index b0b0b94b..00000000
--- a/gfx/blue/sgbborder.map
+++ /dev/null
Binary files differ
diff --git a/gfx/blue/sgbborder.png b/gfx/blue/sgbborder.png
deleted file mode 100644
index 098df2b6..00000000
--- a/gfx/blue/sgbborder.png
+++ /dev/null
Binary files differ
diff --git a/gfx/blue/slotmachine1.png b/gfx/blue/slotmachine1.png
deleted file mode 100644
index 41ebfdea..00000000
--- a/gfx/blue/slotmachine1.png
+++ /dev/null
Binary files differ
diff --git a/gfx/blue/slotmachine2.png b/gfx/blue/slotmachine2.png
deleted file mode 100644
index ee8c688e..00000000
--- a/gfx/blue/slotmachine2.png
+++ /dev/null
Binary files differ
diff --git a/gfx/blue/blueversion.png b/gfx/blueversion.png
index a9c87be8..a9c87be8 100644
--- a/gfx/blue/blueversion.png
+++ b/gfx/blueversion.png
Binary files differ
diff --git a/gfx/copyright.png b/gfx/copyright.png
index 49174349..71a2085f 100644
--- a/gfx/copyright.png
+++ b/gfx/copyright.png
Binary files differ
diff --git a/gfx/emotion_bubbles.png b/gfx/emotion_bubbles.png
index 31deacf4..652c56b1 100644
--- a/gfx/emotion_bubbles.png
+++ b/gfx/emotion_bubbles.png
Binary files differ
diff --git a/gfx/intro_fight.png b/gfx/intro_fight.png
deleted file mode 100644
index d7774c01..00000000
--- a/gfx/intro_fight.png
+++ /dev/null
Binary files differ
diff --git a/gfx/ledge_hopping_shadow.png b/gfx/ledge_hopping_shadow.png
index 8e760056..ba3dab5b 100644
--- a/gfx/ledge_hopping_shadow.png
+++ b/gfx/ledge_hopping_shadow.png
Binary files differ
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/pokemon_logo.png b/gfx/pokemon_logo.png
index cc7582c5..64f9b23f 100644
--- a/gfx/pokemon_logo.png
+++ b/gfx/pokemon_logo.png
Binary files differ
diff --git a/gfx/pokemon_logo_japan.png b/gfx/pokemon_logo_japan.png
new file mode 100644
index 00000000..d75bb302
--- /dev/null
+++ b/gfx/pokemon_logo_japan.png
Binary files differ
diff --git a/gfx/pokemon_yellow.png b/gfx/pokemon_yellow.png
new file mode 100644
index 00000000..7c86a1ec
--- /dev/null
+++ b/gfx/pokemon_yellow.png
Binary files differ
diff --git a/gfx/red/intro_nido_1.png b/gfx/red/intro_nido_1.png
deleted file mode 100644
index 4c7804a1..00000000
--- a/gfx/red/intro_nido_1.png
+++ /dev/null
Binary files differ
diff --git a/gfx/red/intro_nido_2.png b/gfx/red/intro_nido_2.png
deleted file mode 100644
index a29a4814..00000000
--- a/gfx/red/intro_nido_2.png
+++ /dev/null
Binary files differ
diff --git a/gfx/red/intro_nido_3.png b/gfx/red/intro_nido_3.png
deleted file mode 100644
index e920d55d..00000000
--- a/gfx/red/intro_nido_3.png
+++ /dev/null
Binary files differ
diff --git a/gfx/red/redgreenversion.png b/gfx/red/redgreenversion.png
deleted file mode 100644
index e41b4295..00000000
--- a/gfx/red/redgreenversion.png
+++ /dev/null
Binary files differ
diff --git a/gfx/red/sgbborder.map b/gfx/red/sgbborder.map
deleted file mode 100644
index 4077ed8e..00000000
--- a/gfx/red/sgbborder.map
+++ /dev/null
Binary files differ
diff --git a/gfx/red/sgbborder.png b/gfx/red/sgbborder.png
deleted file mode 100644
index 7549bb47..00000000
--- a/gfx/red/sgbborder.png
+++ /dev/null
Binary files differ
diff --git a/gfx/red/slotmachine1.png b/gfx/red/slotmachine1.png
deleted file mode 100644
index 785c74f9..00000000
--- a/gfx/red/slotmachine1.png
+++ /dev/null
Binary files differ
diff --git a/gfx/red/slotmachine2.png b/gfx/red/slotmachine2.png
deleted file mode 100644
index 779d0cd8..00000000
--- a/gfx/red/slotmachine2.png
+++ /dev/null
Binary files differ
diff --git a/gfx/yellow/slotmachine1.png b/gfx/slotmachine1.png
index 335ce97c..335ce97c 100644
--- a/gfx/yellow/slotmachine1.png
+++ b/gfx/slotmachine1.png
Binary files differ
diff --git a/gfx/yellow/slotmachine2.png b/gfx/slotmachine2.png
index b4bdf8a8..b4bdf8a8 100644
--- a/gfx/yellow/slotmachine2.png
+++ b/gfx/slotmachine2.png
Binary files differ
diff --git a/gfx/sprites/bike_shop_guy.png b/gfx/sprites/bike_shop_guy.png
index 1ea83685..da3d5ac6 100644
--- a/gfx/sprites/bike_shop_guy.png
+++ b/gfx/sprites/bike_shop_guy.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/clefairy2.png b/gfx/sprites/clefairy2.png
new file mode 100644
index 00000000..e8502ddd
--- /dev/null
+++ b/gfx/sprites/clefairy2.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/mom_geisha.png b/gfx/sprites/mom_geisha.png
index c9b556ea..13862615 100644
--- a/gfx/sprites/mom_geisha.png
+++ b/gfx/sprites/mom_geisha.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/stats_screen_hp.png b/gfx/stats_screen_hp.png
new file mode 100644
index 00000000..adf086ca
--- /dev/null
+++ b/gfx/stats_screen_hp.png
Binary files differ
diff --git a/gfx/stats_screen_lv.png b/gfx/stats_screen_lv.png
new file mode 100644
index 00000000..0d5c6620
--- /dev/null
+++ b/gfx/stats_screen_lv.png
Binary files differ
diff --git a/gfx/surfing_pikachu_1.png b/gfx/surfing_pikachu_1.png
new file mode 100644
index 00000000..abaf4ba4
--- /dev/null
+++ b/gfx/surfing_pikachu_1.png
Binary files differ
diff --git a/gfx/surfing_pikachu_1a.png b/gfx/surfing_pikachu_1a.png
new file mode 100644
index 00000000..0bc11684
--- /dev/null
+++ b/gfx/surfing_pikachu_1a.png
Binary files differ
diff --git a/gfx/surfing_pikachu_1b.png b/gfx/surfing_pikachu_1b.png
new file mode 100644
index 00000000..a64eb4c7
--- /dev/null
+++ b/gfx/surfing_pikachu_1b.png
Binary files differ
diff --git a/gfx/surfing_pikachu_1c.png b/gfx/surfing_pikachu_1c.png
new file mode 100644
index 00000000..eeedb243
--- /dev/null
+++ b/gfx/surfing_pikachu_1c.png
Binary files differ
diff --git a/gfx/surfing_pikachu_2.png b/gfx/surfing_pikachu_2.png
new file mode 100644
index 00000000..f8752966
--- /dev/null
+++ b/gfx/surfing_pikachu_2.png
Binary files differ
diff --git a/gfx/surfing_pikachu_3.png b/gfx/surfing_pikachu_3.png
new file mode 100644
index 00000000..91d4a607
--- /dev/null
+++ b/gfx/surfing_pikachu_3.png
Binary files differ
diff --git a/gfx/tilemaps/sgbborder.map b/gfx/tilemaps/sgbborder.map
new file mode 100644
index 00000000..9c97c339
--- /dev/null
+++ b/gfx/tilemaps/sgbborder.map
Binary files differ
diff --git a/gfx/tilesets/beachhouse.png b/gfx/tilesets/beachhouse.png
new file mode 100644
index 00000000..f5dccf7a
--- /dev/null
+++ b/gfx/tilesets/beachhouse.png
Binary files differ
diff --git a/gfx/tilesets/beachhouse.tilecoll b/gfx/tilesets/beachhouse.tilecoll
new file mode 100644
index 00000000..54ddac19
--- /dev/null
+++ b/gfx/tilesets/beachhouse.tilecoll
@@ -0,0 +1 @@
+ \ No newline at end of file
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/unknown_f8946.map b/gfx/unknown_f8946.map
new file mode 100644
index 00000000..a89a52b8
--- /dev/null
+++ b/gfx/unknown_f8946.map
@@ -0,0 +1 @@
+           \ No newline at end of file
diff --git a/gfx/unknown_f90bc.map b/gfx/unknown_f90bc.map
new file mode 100644
index 00000000..98b8ba51
--- /dev/null
+++ b/gfx/unknown_f90bc.map
Binary files differ
diff --git a/gfx/unknown_f91ac.map b/gfx/unknown_f91ac.map
new file mode 100644
index 00000000..8a1f06b7
--- /dev/null
+++ b/gfx/unknown_f91ac.map
@@ -0,0 +1 @@
+ \ No newline at end of file
diff --git a/gfx/unknown_f91bb.map b/gfx/unknown_f91bb.map
new file mode 100644
index 00000000..6d8ebb43
--- /dev/null
+++ b/gfx/unknown_f91bb.map
@@ -0,0 +1,2 @@
+
+ \ No newline at end of file
diff --git a/gfx/unknown_f91c8.map b/gfx/unknown_f91c8.map
new file mode 100644
index 00000000..20d18de5
--- /dev/null
+++ b/gfx/unknown_f91c8.map
@@ -0,0 +1 @@
+ \ No newline at end of file
diff --git a/gfx/unknown_f9b6e.map b/gfx/unknown_f9b6e.map
new file mode 100644
index 00000000..3ce924dc
--- /dev/null
+++ b/gfx/unknown_f9b6e.map
Binary files differ
diff --git a/gfx/unknown_f9be6.map b/gfx/unknown_f9be6.map
new file mode 100644
index 00000000..18560135
--- /dev/null
+++ b/gfx/unknown_f9be6.map
@@ -0,0 +1 @@
+0123@ABCPQRS \ No newline at end of file
diff --git a/gfx/unknown_f9bf2.map b/gfx/unknown_f9bf2.map
new file mode 100644
index 00000000..e587b7ce
--- /dev/null
+++ b/gfx/unknown_f9bf2.map
@@ -0,0 +1 @@
+"# \ No newline at end of file
diff --git a/gfx/unknown_f9c2c.png b/gfx/unknown_f9c2c.png
new file mode 100644
index 00000000..b5c68424
--- /dev/null
+++ b/gfx/unknown_f9c2c.png
Binary files differ
diff --git a/gfx/unknown_f9c6c.png b/gfx/unknown_f9c6c.png
new file mode 100644
index 00000000..3725d6cc
--- /dev/null
+++ b/gfx/unknown_f9c6c.png
Binary files differ
diff --git a/gfx/unknown_fd86b.png b/gfx/unknown_fd86b.png
new file mode 100644
index 00000000..20bcf5a7
--- /dev/null
+++ b/gfx/unknown_fd86b.png
Binary files differ
diff --git a/gfx/yellow_intro.png b/gfx/yellow_intro.png
new file mode 100644
index 00000000..a9a2773c
--- /dev/null
+++ b/gfx/yellow_intro.png
Binary files differ
diff --git a/gfx/yellow_titlescreen.png b/gfx/yellow_titlescreen.png
new file mode 100644
index 00000000..285309ce
--- /dev/null
+++ b/gfx/yellow_titlescreen.png
Binary files differ
diff --git a/gfx/zero_one_ea597.png b/gfx/zero_one_ea597.png
new file mode 100644
index 00000000..0c11b9da
--- /dev/null
+++ b/gfx/zero_one_ea597.png
Binary files differ
diff --git a/home.asm b/home.asm
index 199edbaf..9d9b5dd4 100644
--- a/home.asm
+++ b/home.asm
@@ -20,7 +20,7 @@ SECTION "rst 38", ROM0
SECTION "vblank", ROM0
jp VBlank
SECTION "hblank", ROM0
- rst $38
+ jp LCDC
SECTION "timer", ROM0
jp Timer
SECTION "serial", ROM0
@@ -98,24 +98,74 @@ SECTION "Header", ROM0
SECTION "Main", ROM0
+PlayPikachuPCM::
+ ld a, [H_LOADEDROMBANK]
+ 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
+ ld [rNR32], a
+ sla d
+ ret
+
+PlaySoundClipSample::
+ ld a, $3
+.loop
+ dec a
+ jr nz, .loop
+ ret
+
Start::
cp GBC
jr z, .gbc
xor a
jr .ok
.gbc
- ld a, 0
+ ld a, 1
.ok
- ld [wGBC], a
+ ld [hGBC], a
jp Init
+Joypad::
+ homecall_jump _Joypad
+
+ReadJoypad::
+ homecall_jump ReadJoypad_
-INCLUDE "home/joypad.asm"
-INCLUDE "data/map_header_pointers.asm"
INCLUDE "home/overworld.asm"
CheckForUserInterruption::
-; Return carry if Up+Select+B, Start or A are pressed in c frames.
+; Return carry if Up + Select + B, Start or A are pressed in c frames.
; Used only in the intro and title screen.
call DelayFrame
@@ -173,7 +223,7 @@ DrawHPBar::
push hl
push de
- push bc
+ ;push bc
; Left
ld a, $71 ; "HP:"
@@ -229,7 +279,7 @@ DrawHPBar::
add e
ld [hl], a
.done
- pop bc
+ ;pop bc
pop de
pop hl
ret
@@ -292,25 +342,31 @@ LoadFrontSpriteByMonIndex::
pop hl
ld a, [H_LOADEDROMBANK]
push af
- ld a, Bank(CopyUncompressedPicToHL)
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
+ switchbank CopyUncompressedPicToHL
xor a
ld [hStartTileID], a
call CopyUncompressedPicToHL
xor a
ld [wSpriteFlipped], a
pop af
- ld [H_LOADEDROMBANK], 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.
@@ -406,13 +462,24 @@ HandlePartyMenuInput::
ld [wMenuWrappingEnabled], a
ld a, $40
ld [wPartyMenuAnimMonEnabled], a
- call HandleMenuInput_
- call PlaceUnfilledArrowMenuCursor
- ld b, a
- xor a
+ call HandleMenuInputPokemonSelection
+ 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
+ callab 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]
@@ -437,6 +504,14 @@ HandlePartyMenuInput::
call BankswitchBack
and a
ret
+.asm_128f
+ pop af
+ ld hl, PartyMenuText_12cc
+ call PrintText
+ xor a
+ ld [wMenuItemToSwap], a
+ pop af
+ ld [hTilesetType], a
.noPokemonChosen
call BankswitchBack
scf
@@ -450,12 +525,16 @@ HandlePartyMenuInput::
ld [wMenuItemToSwap], a
ld [wPartyMenuTypeOrMessageID], a
call RedrawPartyMenu
- jr HandlePartyMenuInput
+ jp HandlePartyMenuInput
.handleSwap
ld a, [wCurrentMenuItem]
ld [wWhichPokemon], a
callba SwitchPartyMon
- jr HandlePartyMenuInput
+ jp HandlePartyMenuInput
+
+PartyMenuText_12cc::
+ TX_FAR _SleepingPikachuText1
+ db "@"
DrawPartyMenu::
ld hl, DrawPartyMenu_
@@ -493,17 +572,7 @@ PrintStatusCondition::
ret
PrintStatusConditionNotFainted:
- ld a, [H_LOADEDROMBANK]
- push af
- ld a, BANK(PrintStatusAilment)
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
- call PrintStatusAilment ; print status condition
- pop bc
- ld a, b
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
- ret
+ homecall_jump_sf PrintStatusAilment
; function to print pokemon level, leaving off the ":L" if the level is at least 100
; INPUT:
@@ -552,9 +621,7 @@ GetwMoves::
GetMonHeader::
ld a, [H_LOADEDROMBANK]
push af
- ld a, BANK(BaseStats)
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
+ switchbank BaseStats
push bc
push de
push hl
@@ -573,8 +640,8 @@ GetMonHeader::
ld b, $77 ; size of Aerodactyl fossil sprite
cp FOSSIL_AERODACTYL ; Aerodactyl fossil
jr z, .specialID
- cp MEW
- jr z, .mew
+ ;cp MEW
+ ;jr z, .mew
predef IndexToPokedex ; convert pokemon ID in [wd11e] to pokedex number
ld a, [wd11e]
dec a
@@ -592,13 +659,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, MonBaseStatsEnd - MonBaseStats
- ld a, BANK(MewBaseStats)
- call FarCopyData
.done
ld a, [wd0b5]
ld [wMonHIndex], a
@@ -608,8 +668,7 @@ GetMonHeader::
pop de
pop bc
pop af
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
+ call BankswitchCommon
ret
; copy party pokemon's name to wcd6d
@@ -718,7 +777,7 @@ UncompressMonSprite::
ld a, [hli]
ld [wSpriteInputPtr], a ; fetch sprite input pointer
ld a, [hl]
- ld [wSpriteInputPtr+1], a
+ ld [wSpriteInputPtr + 1], a
; define (by index number) the bank that a pokemon's image is in
; index = Mew, bank 1
; index = Kabutops fossil, bank $B
@@ -726,13 +785,13 @@ UncompressMonSprite::
; $1F ≤ index < $4A, bank $A
; $4A ≤ index < $74, bank $B
; $74 ≤ index < $99, bank $C
-; $99 ≤ index, bank $D
+; $99 ≤ index, bank $D
ld a, [wcf91] ; XXX name for this ram location
ld b, a
- cp MEW
- ld a, BANK(MewPicFront)
- jr z, .GotBank
- ld a, b
+ ;cp MEW
+ ;ld a, BANK(MewPicFront)
+ ;jr z, .GotBank
+ ;ld a, b
cp FOSSIL_KABUTOPS
ld a, BANK(FossilKabutopsPic)
jr z, .GotBank
@@ -770,7 +829,7 @@ LoadMonFrontSprite::
; postprocesses uncompressed sprite chunks to a 2bpp sprite and loads it into video ram
; calculates alignment parameters to place both sprite chunks in the center of the 7*7 tile sprite buffers
; de: destination location
-; a,c: sprite dimensions (in tiles of 8x8 each)
+; a, c: sprite dimensions (in tiles of 8x8 each)
LoadUncompressedSpriteData::
push de
and $f
@@ -803,8 +862,8 @@ LoadUncompressedSpriteData::
add a
add a ; 8*(7*((8-w)/2) + 7-h) ; combined overall offset (in bytes)
ld [H_SPRITEOFFSET], a
- xor a
- ld [$4000], a
+ ld a, $0
+ call SwitchSRAMBankAndLatchClockData
ld hl, sSpriteBuffer0
call ZeroSpriteBuffer ; zero buffer 0
ld de, sSpriteBuffer1
@@ -815,6 +874,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
@@ -861,8 +921,8 @@ ZeroSpriteBuffer::
; in the resulting sprite, the rows of the two source sprites are interlaced
; de: output address
InterlaceMergeSpriteBuffers::
- xor a
- ld [$4000], 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
@@ -904,16 +964,26 @@ InterlaceMergeSpriteBuffers::
ld c, (2*SPRITEBUFFERSIZE)/16 ; $31, number of 16 byte chunks to be copied
ld a, [H_LOADEDROMBANK]
ld b, a
- jp CopyVideoData
+ call CopyVideoData
+ jp PrepareRTCDataAndDisableSRAM
+
+INCLUDE "home/pikachu.asm"
+;INCLUDE "data/collision.asm"
+INCLUDE "home/lcdc.asm"
+
+IsTilePassable::
+; sets carry if tile is passable, resets carry otherwise
+ homecall_sf _IsTilePassable
+ ret
-INCLUDE "data/collision.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"
@@ -925,13 +995,14 @@ UpdateSprites::
ret nz
ld a, [H_LOADEDROMBANK]
push af
- ld a, Bank(_UpdateSprites)
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
+ switchbank _UpdateSprites
+ ld a, $ff
+ ld [wUpdateSpritesEnabled], a
call _UpdateSprites
+ ld a, $1
+ ld [wUpdateSpritesEnabled], a
pop af
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
+ call BankswitchCommon
ret
INCLUDE "data/mart_inventories.asm"
@@ -990,7 +1061,8 @@ ResetPlayerSpriteData::
ResetPlayerSpriteData_ClearSpriteData::
ld bc, $10
xor a
- jp FillMemory
+ call FillMemory
+ ret
FadeOutAudio::
ld a, [wAudioFadeOutControl]
@@ -1032,15 +1104,17 @@ FadeOutAudio::
ld b, a
xor a
ld [wAudioFadeOutControl], a
- ld a, $ff
- ld [wNewSoundID], a
- call PlaySound
+ call StopAllMusic
ld a, [wAudioSavedROMBank]
ld [wAudioROMBank], a
ld a, b
ld [wNewSoundID], a
jp PlaySound
+UnknownText_2812::
+ TX_FAR _PokemonText
+ db "@"
+
; this function is used to display sign messages, sprite dialog, etc.
; INPUT: [hSpriteIndexOrTextID] = sprite ID or text ID
DisplayTextID::
@@ -1065,6 +1139,8 @@ DisplayTextID::
ld [wSpriteIndex], a
and a
jp z, DisplayStartMenu
+ cp TEXT_PIKACHU_ANIM
+ jp z, DisplayPikachuEmotion
cp TEXT_SAFARI_GAME_OVER
jp z, DisplaySafariGameOverText
cp TEXT_MON_FAINTED
@@ -1082,20 +1158,18 @@ DisplayTextID::
.spriteHandling
; get the text ID of the sprite
push hl
- push de
- push bc
- callba UpdateSpriteFacingOffsetAndDelayMovement ; update the graphics of the sprite the player is talking to (to face the right direction)
- pop bc
- pop de
+ ;push de
+ ;push bc
+ ;callba 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
ld 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
@@ -1103,7 +1177,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]
@@ -1171,9 +1246,6 @@ CloseTextDisplay::
add hl, de
dec c
jr nz, .restoreSpriteFacingDirectionLoop
- ld a, BANK(InitMapSprites)
- ld [H_LOADEDROMBANK], 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]
@@ -1182,8 +1254,7 @@ CloseTextDisplay::
call z, LoadPlayerSpriteGraphics
call LoadCurrentMapView
pop af
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
+ call BankswitchCommon
jp UpdateSprites
DisplayPokemartDialogue::
@@ -1195,15 +1266,7 @@ DisplayPokemartDialogue::
call LoadItemList
ld a, PRICEDITEMLISTMENU
ld [wListMenuID], a
- ld a, [H_LOADEDROMBANK]
- push af
- ld a, Bank(DisplayPokemartDialogue_)
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
- call DisplayPokemartDialogue_
- pop af
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
+ homecall DisplayPokemartDialogue_
jp AfterDisplayingTextID
PokemartGreetingText::
@@ -1234,15 +1297,7 @@ DisplayPokemonCenterDialogue::
ld [$ff8d], a
inc hl
- ld a, [H_LOADEDROMBANK]
- push af
- ld a, Bank(DisplayPokemonCenterDialogue_)
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
- call DisplayPokemonCenterDialogue_
- pop af
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
+ homecall DisplayPokemonCenterDialogue_
jp AfterDisplayingTextID
DisplaySafariGameOverText::
@@ -1264,6 +1319,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::
@@ -1279,6 +1344,10 @@ RepelWoreOffText::
TX_FAR _RepelWoreOffText
db "@"
+DisplayPikachuEmotion::
+ callab TalkToPikachu
+ jp CloseTextDisplay
+
INCLUDE "engine/menu/start_menu.asm"
; function to count how many bits are set in a string of bytes
@@ -1330,15 +1399,7 @@ AddAmountSoldToMoney::
; [wWhichPokemon] = index (within the inventory) of the item to remove
; [wItemQuantity] = quantity to remove
RemoveItemFromInventory::
- ld a, [H_LOADEDROMBANK]
- push af
- ld a, BANK(RemoveItemFromInventory_)
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
- call RemoveItemFromInventory_
- pop af
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
+ homecall RemoveItemFromInventory_
ret
; function to add an item (in varying quantities) to the player's bag or PC box
@@ -1349,16 +1410,7 @@ RemoveItemFromInventory::
; sets carry flag if successful, unsets carry flag if unsuccessful
AddItemToInventory::
push bc
- ld a, [H_LOADEDROMBANK]
- push af
- ld a, BANK(AddItemToInventory_)
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
- call AddItemToInventory_
- pop bc
- ld a, b
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
+ homecall_sf AddItemToInventory_
pop bc
ret
@@ -1432,7 +1484,7 @@ DisplayListMenuIDLoop::
.oldManBattle
ld a, "▶"
Coorda 5, 4 ; place menu cursor in front of first menu entry
- ld c, 80
+ ld c, 20
call DelayFrames
xor a
ld [wCurrentMenuItem], a
@@ -1559,15 +1611,13 @@ DisplayListMenuIDLoop::
DisplayChooseQuantityMenu::
; text box dimensions/coordinates for just quantity
coord hl, 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
coord hl, 7, 9
- ld b, 1 ; height
- ld c, 11 ; width
+ lb bc, 1, 11 ; height and width
.drawTextBox
call TextBoxBorder
coord hl, 16, 10
@@ -1699,8 +1749,7 @@ ExitListMenu::
PrintListMenuEntries::
coord hl, 5, 3
- ld b, 9
- ld c, 14
+ lb bc, 9, 14
call ClearScreenArea
ld a, [wListPointer]
ld e, a
@@ -1715,7 +1764,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
@@ -1864,7 +1913,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
@@ -2016,7 +2065,7 @@ IsMoveHM::
jp IsInArray
HMMoves::
- db CUT,FLY,SURF,STRENGTH,FLASH
+ db CUT, FLY, SURF, STRENGTH, FLASH
db $ff ; terminator
GetMoveName::
@@ -2044,8 +2093,7 @@ ReloadMapData::
call LoadTilesetTilePatternData
call EnableLCD
pop af
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
+ call BankswitchCommon
ret
; reloads tileset tile patterns
@@ -2058,8 +2106,7 @@ ReloadTilesetTilePatterns::
call LoadTilesetTilePatternData
call EnableLCD
pop af
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
+ call BankswitchCommon
ret
; shows the town map and lets the player choose a destination to fly to
@@ -2068,6 +2115,34 @@ ChooseFlyDestination::
res 4, [hl]
jpba LoadTownMap_Fly
+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
+ ld [rSB], a
+ ld a, $1
+ ld [rSC], a
+ ld a, START_TRANSFER_INTERNAL_CLOCK
+ ld [rSC], a
+ ret
+
; causes the text box to close without waiting for a button press after displaying text
DisableWaitingAfterTextDisplay::
ld a, $01
@@ -2129,16 +2204,89 @@ IsKeyItem::
; [wTextBoxID] = text box ID
; b, c = y, x cursor position (TWO_OPTION_MENU only)
DisplayTextBoxID::
- ld a, [H_LOADEDROMBANK]
+ homecall_sf DisplayTextBoxID_
+ ret
+
+UpdateGBCPal_BGP::
push af
- ld a, BANK(DisplayTextBoxID_)
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
- call DisplayTextBoxID_
+ ld a, [hGBC]
+ and a
+ jr z, .notGBC
+ push bc
+ push de
+ push hl
+ ld a, [rBGP]
+ ld b, a
+ ld a, [wLastBGP]
+ cp b
+ jr z, .noChangeInBGP
+ callba _UpdateGBCPal_BGP
+.noChangeInBGP
+ pop hl
+ pop de
pop bc
- ld a, b
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
+.notGBC
+ pop af
+ ret
+
+UpdateGBCPal_OBP0::
+ push af
+ ld a, [hGBC]
+ and a
+ jr z, .notGBC
+ push bc
+ push de
+ push hl
+ ld 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
+ ld a, [hGBC]
+ and a
+ jr z, .notGBC
+ push bc
+ push de
+ push hl
+ ld 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::
+ ld a, [H_LOADEDROMBANK]
+ push af
+ call FadeOutAudio
+ callbs Music_DoLowHealthAlarm
+ callbs Audio1_UpdateMusic
+ pop af
+ call BankswitchCommon
ret
; not zero if an NPC movement script is running, the player character is
@@ -2174,13 +2322,11 @@ RunNPCMovementScript::
ld a, [H_LOADEDROMBANK]
push af
ld a, [wNPCMovementScriptBank]
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
+ call BankswitchCommon
ld a, [wNPCMovementScriptFunctionNum]
call CallFunctionInTable
pop af
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
+ call BankswitchCommon
ret
.NPCMovementScriptPointerTables
@@ -2201,7 +2347,7 @@ StoreTrainerHeaderPointer::
ld a, h
ld [wTrainerHeaderPtr], a
ld a, l
- ld [wTrainerHeaderPtr+1], a
+ ld [wTrainerHeaderPtr + 1], a
ret
; executes the current map script from the function pointer array provided in hl.
@@ -2575,17 +2721,6 @@ TrainerEndBattleText::
call TextCommandProcessor
jp TextScriptEnd
-; only engage withe 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_SONY1
@@ -2599,8 +2734,7 @@ PlayTrainerMusic::
ret nz
xor a
ld [wAudioFadeOutControl], a
- ld a, $ff
- call PlaySound
+ call StopAllMusic ; stop music
ld a, BANK(Music_MeetEvilTrainer)
ld [wAudioROMBank], a
ld [wAudioSavedROMBank], a
@@ -2705,6 +2839,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 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
+ callab IsStarterPikachuInOurParty
+ pop bc
+ pop hl
+ ret nc
+ ld a, [wd472]
+ set 7, a
+ ld [wd472], a
+ ret
+
DisplayPokedex::
ld [wd11e], a
jpba _DisplayPokedex
@@ -2728,6 +2916,26 @@ SetSpriteImageIndexAfterSettingFacingDirection::
ld [hl], a
ret
+SpriteFunc_34a1::
+ ld a, [H_SPRITEINDEX]
+ swap a
+ add $e
+ ld l, a
+ ld h, $c2
+ ld c, [hl]
+ dec c
+ swap c
+ ld a, [$ff8d]
+ add c
+ ld c, a
+ ld a, [$ff8c]
+ 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
@@ -2876,8 +3084,8 @@ GetSpriteMovementByte2Pointer::
ld a, [H_SPRITEINDEX]
dec a
add a
- ld d, 0
ld e, a
+ ld d, 0
add hl, de
pop de
ret
@@ -2887,7 +3095,7 @@ GetTrainerInformation::
ld a, [wLinkState]
and a
jr nz, .linkBattle
- ld a, Bank(TrainerPicAndMoneyPointers)
+ ld a, BANK(TrainerPicAndMoneyPointers)
call BankswitchHome
ld a, [wTrainerClass]
dec a
@@ -2906,6 +3114,7 @@ GetTrainerInformation::
inc de
ld a, [hli]
ld [de], a
+ call IsFightingJessieJames
jp BankswitchBack
.linkBattle
ld hl, wTrainerPicPointer
@@ -2915,6 +3124,24 @@ 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::
jpba GetTrainerName_
@@ -2942,33 +3169,13 @@ BankswitchHome::
ld a, [H_LOADEDROMBANK]
ld [wBankswitchHomeSavedROMBank], a
ld a, [wBankswitchHomeTemp]
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
+ call BankswitchCommon
ret
BankswitchBack::
; returns from BankswitchHome
ld a, [wBankswitchHomeSavedROMBank]
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
- ret
-
-Bankswitch::
-; self-contained bankswitch, use this when not in the home bank
-; switches to the bank in b
- ld a, [H_LOADEDROMBANK]
- push af
- ld a, b
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
- ld bc, .Return
- push bc
- jp hl
-.Return
- pop bc
- ld a, b
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
+ call BankswitchCommon
ret
; displays yes/no choice
@@ -2978,7 +3185,7 @@ YesNoChoice::
call InitYesNoTextBoxParameters
jr DisplayYesNoChoice
-Func_35f4::
+Func_35f7::
ld a, TWO_OPTION_MENU
ld [wTextBoxID], a
call InitYesNoTextBoxParameters
@@ -3104,7 +3311,7 @@ LoadTextBoxTilePatterns::
ld de, vChars2 + $600
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 + $600
@@ -3120,29 +3327,13 @@ LoadHpBarAndStatusTilePatterns::
ld de, vChars2 + $620
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 + $620
lb bc, BANK(HpBarAndStatusGraphics), (HpBarAndStatusGraphicsEnd - HpBarAndStatusGraphics) / $10
jp CopyVideoData ; if LCD is on, transfer during V-blank
-
-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
@@ -3155,8 +3346,7 @@ SaveScreenTilesToBuffer2::
coord hl, 0, 0
ld de, wTileMapBackup2
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
- call CopyData
- ret
+ jp CopyData
LoadScreenTilesFromBuffer2::
call LoadScreenTilesFromBuffer2DisableBGTransfer
@@ -3171,8 +3361,7 @@ LoadScreenTilesFromBuffer2DisableBGTransfer::
ld hl, wTileMapBackup2
coord de, 0, 0
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
- call CopyData
- ret
+ jp CopyData
SaveScreenTilesToBuffer1::
coord hl, 0, 0
@@ -3219,6 +3408,7 @@ WaitForSoundToFinish::
inc hl
inc hl
or [hl]
+ and a
jr nz, .waitLoop
pop hl
ret
@@ -3265,8 +3455,7 @@ GetName::
.otherEntries
;2-7 = OTHER ENTRIES
ld a, [wPredefBank]
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
+ call BankswitchCommon
ld a, [wNameListType] ;VariousNames' entryID
dec a
add a
@@ -3313,8 +3502,7 @@ GetName::
pop bc
pop hl
pop af
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
+ call BankswitchCommon
ret
GetItemPrice::
@@ -3328,8 +3516,7 @@ GetItemPrice::
jr nz, .ok
ld a, $f ; hardcoded Bank
.ok
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
+ call BankswitchCommon
ld hl, wItemPrices
ld a, [hli]
ld h, [hl]
@@ -3351,15 +3538,11 @@ GetItemPrice::
ld [hItemPrice], a
jr .done
.getTMPrice
- ld a, Bank(GetMachinePrice)
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
- call GetMachinePrice
+ callbs GetMachinePrice
.done
ld de, hItemPrice
pop af
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
+ call BankswitchCommon
ret
; copies a string from [de] to [wcf4b]
@@ -3444,7 +3627,11 @@ WaitForTextScrollButtonPress::
ld a, [wTownMapSpriteBlinkingEnabled]
and a
jr z, .skipAnimation
- call TownMapSpriteBlinkingAnimation
+ push de
+ push bc
+ callab TownMapSpriteBlinkingAnimation
+ pop bc
+ pop de
.skipAnimation
coord hl, 18, 16
call HandleDownArrowBlinkTiming
@@ -3466,6 +3653,7 @@ ManualTextScroll::
cp LINK_STATE_BATTLING
jr z, .inLinkBattle
call WaitForTextScrollButtonPress
+ call WaitForSoundToFinish
ld a, SFX_PRESS_AB
jp PlaySound
.inLinkBattle
@@ -3500,15 +3688,7 @@ Divide::
push hl
push de
push bc
- ld a, [H_LOADEDROMBANK]
- push af
- ld a, Bank(_Divide)
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
- call _Divide
- pop af
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
+ homecall _Divide
pop bc
pop de
pop hl
@@ -3598,10 +3778,10 @@ CalcStats::
.statsLoop
inc c
call CalcStat
- ld a, [H_MULTIPLICAND+1]
+ ld a, [H_MULTIPLICAND + 1]
ld [de], a
inc de
- ld a, [H_MULTIPLICAND+2]
+ ld a, [H_MULTIPLICAND + 2]
ld [de], a
inc de
ld a, c
@@ -3610,7 +3790,7 @@ CalcStats::
ret
; calculates stat c of current mon
-; c: stat to calc (HP=1,Atk=2,Def=3,Spd=4,Spc=5)
+; c: stat to calc (HP=1, Atk=2, Def=3, Spd=4, Spc=5)
; b: consider stat exp?
; hl: base ptr to stat exp values ([hl + 2*c - 1] and [hl + 2*c])
CalcStat::
@@ -3635,12 +3815,12 @@ CalcStat::
.statExpLoop ; calculates ceil(Sqrt(stat exp)) in b
xor a
ld [H_MULTIPLICAND], a
- ld [H_MULTIPLICAND+1], a
+ ld [H_MULTIPLICAND + 1], a
inc b ; increment current stat exp bonus
ld a, b
cp $ff
jr z, .statExpDone
- ld [H_MULTIPLICAND+2], a
+ ld [H_MULTIPLICAND + 2], a
ld [H_MULTIPLIER], a
call Multiply
ld a, [hld]
@@ -3729,9 +3909,9 @@ CalcStat::
jr nc, .noCarry2
inc d ; de = (Base + IV) * 2 + ceil(Sqrt(stat exp)) / 4
.noCarry2
- ld [H_MULTIPLICAND+2], a
+ ld [H_MULTIPLICAND + 2], a
ld a, d
- ld [H_MULTIPLICAND+1], a
+ ld [H_MULTIPLICAND + 1], a
xor a
ld [H_MULTIPLICAND], a
ld a, [wCurEnemyLVL]
@@ -3739,10 +3919,10 @@ CalcStat::
call Multiply ; ((Base + IV) * 2 + ceil(Sqrt(stat exp)) / 4) * Level
ld a, [H_MULTIPLICAND]
ld [H_DIVIDEND], a
- ld a, [H_MULTIPLICAND+1]
- ld [H_DIVIDEND+1], a
- ld a, [H_MULTIPLICAND+2]
- ld [H_DIVIDEND+2], a
+ ld a, [H_MULTIPLICAND + 1]
+ ld [H_DIVIDEND + 1], a
+ ld a, [H_MULTIPLICAND + 2]
+ ld [H_DIVIDEND + 2], a
ld a, $64
ld [H_DIVISOR], a
ld a, $3
@@ -3754,38 +3934,38 @@ CalcStat::
jr nz, .notHPStat
ld a, [wCurEnemyLVL]
ld b, a
- ld a, [H_MULTIPLICAND+2]
+ ld a, [H_MULTIPLICAND + 2]
add b
- ld [H_MULTIPLICAND+2], a
+ ld [H_MULTIPLICAND + 2], a
jr nc, .noCarry3
- ld a, [H_MULTIPLICAND+1]
+ ld a, [H_MULTIPLICAND + 1]
inc a
- ld [H_MULTIPLICAND+1], a ; HP: (((Base + IV) * 2 + ceil(Sqrt(stat exp)) / 4) * Level) / 100 + Level
+ ld [H_MULTIPLICAND + 1], a ; HP: (((Base + IV) * 2 + ceil(Sqrt(stat exp)) / 4) * Level) / 100 + Level
.noCarry3
- ld a, 10 ; +10 for HP stat
+ ld a, 10 ; + 10 for HP stat
.notHPStat
ld b, a
- ld a, [H_MULTIPLICAND+2]
+ ld a, [H_MULTIPLICAND + 2]
add b
- ld [H_MULTIPLICAND+2], a
+ ld [H_MULTIPLICAND + 2], a
jr nc, .noCarry4
- ld a, [H_MULTIPLICAND+1]
+ ld a, [H_MULTIPLICAND + 1]
inc a ; non-HP: (((Base + IV) * 2 + ceil(Sqrt(stat exp)) / 4) * Level) / 100 + 5
- ld [H_MULTIPLICAND+1], a ; HP: (((Base + IV) * 2 + ceil(Sqrt(stat exp)) / 4) * Level) / 100 + Level + 10
+ ld [H_MULTIPLICAND + 1], a ; HP: (((Base + IV) * 2 + ceil(Sqrt(stat exp)) / 4) * Level) / 100 + Level + 10
.noCarry4
- ld a, [H_MULTIPLICAND+1] ; check for overflow (>999)
+ ld a, [H_MULTIPLICAND + 1] ; check for overflow (>999)
cp 999 / $100 + 1
jr nc, .overflow
cp 999 / $100
jr c, .noOverflow
- ld a, [H_MULTIPLICAND+2]
+ ld a, [H_MULTIPLICAND + 2]
cp 999 % $100 + 1
jr c, .noOverflow
.overflow
ld a, 999 / $100 ; overflow: cap at 999
- ld [H_MULTIPLICAND+1], a
+ ld [H_MULTIPLICAND + 1], a
ld a, 999 % $100
- ld [H_MULTIPLICAND+2], a
+ ld [H_MULTIPLICAND + 2], a
.noOverflow
pop bc
pop de
@@ -3793,29 +3973,11 @@ CalcStat::
ret
AddEnemyMonToPlayerParty::
- ld a, [H_LOADEDROMBANK]
- push af
- ld a, BANK(_AddEnemyMonToPlayerParty)
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
- call _AddEnemyMonToPlayerParty
- pop bc
- ld a, b
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
+ homecall_sf _AddEnemyMonToPlayerParty
ret
MoveMon::
- ld a, [H_LOADEDROMBANK]
- push af
- ld a, BANK(_MoveMon)
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
- call _MoveMon
- pop bc
- ld a, b
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
+ homecall_sf _MoveMon
ret
; skips a text entries, each of size NAME_LENGTH (like trainer name, OT name, rival name, ...)
@@ -3893,7 +4055,7 @@ HandleMenuInput::
xor a
ld [wPartyMenuAnimMonEnabled], a
-HandleMenuInput_::
+HandleMenuInputPokemonSelection::
ld a, [H_DOWNARROWBLINKCNT1]
push af
ld a, [H_DOWNARROWBLINKCNT2]
@@ -3941,6 +4103,8 @@ HandleMenuInput_::
ld [wCheckFor180DegreeTurn], a
ld a, [hJoy5]
ld b, a
+ bit 0, a ; pressed A key?
+ jr nz, .checkOtherKeys
bit 6, a ; pressed Up key?
jr z, .checkIfDownPressed
.upPressed
@@ -4026,15 +4190,13 @@ PlaceMenuCursor::
ld a, [wLastMenuItem]
and a ; was the previous menu id 0?
jr z, .checkForArrow1
+ ld bc, 40
push af
- ld a, [hFlags_0xFFF6]
+ ld a, [hFlags_0xFFFA]
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
@@ -4052,15 +4214,13 @@ PlaceMenuCursor::
ld a, [wCurrentMenuItem]
and a
jr z, .checkForArrow2
+ ld bc, 40
push af
- ld a, [hFlags_0xFFF6]
+ ld a, [hFlags_0xFFFA]
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
@@ -4184,6 +4344,16 @@ PrintText_NoCreatingTextBox::
coord bc, 1, 14
jp TextCommandProcessor
+FarPrintText::
+; print text b:hl at (1, 14)
+ ld a, [H_LOADEDROMBANK]
+ push af
+ ld a, b
+ call BankswitchCommon
+ call PrintText
+ pop af
+ call BankswitchCommon
+ ret
PrintNumber::
; Print the c-digit, b-byte value at de.
@@ -4453,6 +4623,8 @@ IsInRestOfArray::
scf
ret
+InitMapSprites::
+ jpab _InitMapSprites
RestoreScreenTilesAndReloadTilePatterns::
call ClearSprites
@@ -4480,6 +4652,9 @@ GBPalNormal::
ld [rBGP], a
ld a, %11010000 ; 3100
ld [rOBP0], a
+ call UpdateGBCPal_BGP
+ call UpdateGBCPal_OBP0
+ call UpdateGBCPal_OBP1
ret
GBPalWhiteOut::
@@ -4488,6 +4663,9 @@ GBPalWhiteOut::
ld [rBGP], a
ld [rOBP0], a
ld [rOBP1], a
+ call UpdateGBCPal_BGP
+ call UpdateGBCPal_OBP0
+ call UpdateGBCPal_OBP1
ret
@@ -4525,7 +4703,7 @@ ReloadMapSpriteTilePatterns::
xor a
ld [wSpriteSetID], a
call DisableLCD
- callba InitMapSprites
+ call InitMapSprites
call EnableLCD
pop hl
pop af
@@ -4562,7 +4740,6 @@ GivePokemon::
ld [wMonDataLocation], a
jpba _GivePokemon
-
Random::
; Return a random number in a.
; For battles, use BattleRandom.
@@ -4576,12 +4753,52 @@ Random::
pop hl
ret
+BankswitchCommon::
+ ld [H_LOADEDROMBANK], a
+ ld [MBC1RomBank], a
+ ret
-INCLUDE "home/predef.asm"
+Bankswitch::
+; self-contained bankswitch, use this when not in the home bank
+; switches to the bank in b
+ ld a, [H_LOADEDROMBANK]
+ push af
+ ld a, b
+ ld [H_LOADEDROMBANK], a
+ ld [MBC1RomBank], a
+ call JumpToAddress
+ pop bc
+ ld a, b
+ ld [H_LOADEDROMBANK], 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
+
+INCLUDE "home/predef.asm"
UpdateCinnabarGymGateTileBlocks::
- jpba UpdateCinnabarGymGateTileBlocks_
+ callba UpdateCinnabarGymGateTileBlocks_
+ ret ; again?
+ ;jp Bankswitch
CheckForHiddenObjectOrBookshelfOrCardKeyDoor::
ld a, [H_LOADEDROMBANK]
@@ -4590,23 +4807,19 @@ CheckForHiddenObjectOrBookshelfOrCardKeyDoor::
bit 0, a ; A button
jr z, .nothingFound
; A button is pressed
- ld a, Bank(CheckForHiddenObject)
- ld [MBC1RomBank], a
- ld [H_LOADEDROMBANK], a
- call CheckForHiddenObject
+ callbs CheckForHiddenObject
ld a, [$ffee]
and a
jr nz, .hiddenObjectNotFound
- ld a, [wHiddenObjectFunctionRomBank]
- ld [MBC1RomBank], a
- ld [H_LOADEDROMBANK], a
- ld de, .returnAddress
- push de
- jp hl
-.returnAddress
xor a
+ ld [$ffeb], a
+ ld a, [wHiddenObjectFunctionRomBank]
+ call BankswitchCommon
+ call JumpToAddress
+ ld a, [$ffeb]
jr .done
.hiddenObjectNotFound
+ predef GetTileAndCoordsInFrontOfPlayer
callba PrintBookshelfText
ld a, [$ffdb]
and a
@@ -4616,8 +4829,7 @@ CheckForHiddenObjectOrBookshelfOrCardKeyDoor::
.done
ld [$ffeb], a
pop af
- ld [MBC1RomBank], a
- ld [H_LOADEDROMBANK], a
+ call BankswitchCommon
ret
PrintPredefTextID::
@@ -4661,58 +4873,60 @@ const_value = 1
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
+ add_tx_pre UnusedBenchGuyText2 ; 1E
+ add_tx_pre UnusedBenchGuyText3 ; 1F
+ add_tx_pre UnusedPredefText ; 20
+ 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
+ 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 XXX unused
+ add_tx_pre VermilionGymTrashSuccessText1 ; 3D
+ add_tx_pre VermilionGymTrashSuccessText2 ; 3E
+ 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/home/audio.asm b/home/audio.asm
index 242f038b..fa7020ee 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,35 +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
+ callba Audio1_UpdateMusic
pop hl
pop bc
dec c
@@ -137,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
+ ld [rNR10], a
+ ret
+
+StopAllMusic::
+ ld a, $FF
+ ld [wNewSoundID], a
; plays music specified by a. If value is $ff, music is stopped
PlaySound::
push hl
@@ -170,49 +182,115 @@ 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::
ld a, [H_LOADEDROMBANK]
- ld [hSavedROMBank], a
+ push af
ld a, [wAudioROMBank]
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
- cp BANK(Audio1_PlaySound)
- jr nz, .checkForAudio2
+ 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
-; audio 1
+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::
+ ld a, [H_LOADEDROMBANK]
+ push af
+ ld a, [wAudioROMBank]
+ call BankswitchCommon
+; determine the audio function, based on the bank
+ cp BANK(Audio1_PlaySound)
+ jr nz, .checkForBank08
+; bank 02 (audio 1)
ld a, b
call Audio1_PlaySound
- jr .next2
+ jr .done
-.checkForAudio2
+.checkForBank08
cp BANK(Audio2_PlaySound)
- jr nz, .audio3
-
-; audio 2
+ jr nz, .checkForBank1F
+; bank 08 (audio 2)
ld a, b
call Audio2_PlaySound
- jr .next2
+ jr .done
-.audio3
+.checkForBank1F
+ cp BANK(Audio3_PlaySound)
+ jr nz, .bank20
+; bank 1f (audio 3)
ld a, b
call Audio3_PlaySound
-
-.next2
- ld a, [hSavedROMBank]
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
jr .done
-.fadeOut
+.bank20
+; invalid banks will default to XX:6bd4
+; 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/copy.asm b/home/copy.asm
index be9c8c0c..d2228405 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
ld a, [H_LOADEDROMBANK]
push af
- ld a, [wBuffer]
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
+ ld a, [wFarCopyDataSavedROMBank]
+ call BankswitchCommon
call CopyData
pop af
- ld [H_LOADEDROMBANK], 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::
+ ld 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::
+ ld 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 d4f35668..c14112bb 100644
--- a/home/copy2.asm
+++ b/home/copy2.asm
@@ -1,62 +1,36 @@
-FarCopyData2::
-; Identical to FarCopyData, but uses hROMBankTemp
-; as temp space instead of wBuffer.
- ld [hROMBankTemp], a
- ld a, [H_LOADEDROMBANK]
- push af
- ld a, [hROMBankTemp]
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
- call CopyData
- pop af
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
- ret
-
-FarCopyData3::
-; Copy bc bytes from a:de to hl.
- ld [hROMBankTemp], a
- ld a, [H_LOADEDROMBANK]
- push af
- ld a, [hROMBankTemp]
- ld [H_LOADEDROMBANK], 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
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
- ret
-
FarCopyDataDouble::
; Expand bc bytes of 1bpp image data
-; from a:hl to 2bpp data at de.
- ld [hROMBankTemp], a
+; from a:de to 2bpp data at hl.
+ ld [wFarCopyDataSavedROMBank], a
ld a, [H_LOADEDROMBANK]
push af
- ld a, [hROMBankTemp]
- ld [H_LOADEDROMBANK], 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
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
+ call BankswitchCommon
ret
CopyVideoData::
@@ -70,11 +44,10 @@ CopyVideoData::
ld [H_AUTOBGTRANSFERENABLED], a
ld a, [H_LOADEDROMBANK]
- ld [hROMBankTemp], a
+ push af
ld a, b
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
+ call BankswitchCommon
ld a, e
ld [H_VBCOPYSRC], a
@@ -94,9 +67,8 @@ CopyVideoData::
.done
ld [H_VBCOPYSIZE], a
call DelayFrame
- ld a, [hROMBankTemp]
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
+ pop af
+ call BankswitchCommon
pop af
ld [H_AUTOBGTRANSFERENABLED], a
ret
@@ -119,11 +91,10 @@ CopyVideoDataDouble::
xor a ; disable auto-transfer while copying
ld [H_AUTOBGTRANSFERENABLED], a
ld a, [H_LOADEDROMBANK]
- ld [hROMBankTemp], a
+ push af
ld a, b
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
+ call BankswitchCommon
ld a, e
ld [H_VBCOPYDOUBLESRC], a
@@ -143,9 +114,8 @@ CopyVideoDataDouble::
.done
ld [H_VBCOPYDOUBLESIZE], a
call DelayFrame
- ld a, [hROMBankTemp]
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
+ pop af
+ call BankswitchCommon
pop af
ld [H_AUTOBGTRANSFERENABLED], a
ret
@@ -159,6 +129,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
+ ld a, [H_LOADEDROMBANK]
+ 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/fade.asm b/home/fade.asm
index 9482fcb0..1259f92b 100644
--- a/home/fade.asm
+++ b/home/fade.asm
@@ -1,7 +1,7 @@
; These routines manage gradual fading
; (e.g., entering a doorway)
LoadGBPal::
- ld a, [wMapPalOffset] ;tells if wCurMap is dark (requires HM5_FLASH?)
+ ld a, [wMapPalOffset] ; tells if wCurMap is dark (requires HM5_FLASH?)
ld b, a
ld hl, FadePal4
ld a, l
@@ -16,6 +16,9 @@ LoadGBPal::
ld [rOBP0], a
ld a, [hli]
ld [rOBP1], a
+ call UpdateGBCPal_BGP
+ call UpdateGBCPal_OBP0
+ call UpdateGBCPal_OBP1
ret
GBFadeInFromBlack::
@@ -34,6 +37,9 @@ GBFadeIncCommon:
ld [rOBP0], a
ld a, [hli]
ld [rOBP1], a
+ call UpdateGBCPal_BGP
+ call UpdateGBCPal_OBP0
+ call UpdateGBCPal_OBP1
ld c, 8
call DelayFrames
dec b
@@ -56,6 +62,9 @@ GBFadeDecCommon:
ld [rOBP0], a
ld a, [hld]
ld [rBGP], a
+ call UpdateGBCPal_BGP
+ call UpdateGBCPal_OBP0
+ call UpdateGBCPal_OBP1
ld c, 8
call DelayFrames
dec b
diff --git a/home/init.asm b/home/init.asm
index cb5c6583..a2f7f786 100644
--- a/home/init.asm
+++ b/home/init.asm
@@ -54,7 +54,7 @@ rLCDC_DEFAULT EQU %11100011
call ClearVram
ld hl, $ff80
- ld bc, $ffff - $ff80
+ ld bc, $fffe - $ff80
call FillMemory
call ClearSprites
@@ -70,6 +70,8 @@ rLCDC_DEFAULT EQU %11100011
ld [hSCX], a
ld [hSCY], a
ld [rIF], a
+ ld [wc0f3], a
+ ld [wc0f4], a
ld a, 1 << VBLANK + 1 << TIMER + 1 << SERIAL
ld [rIE], a
@@ -126,12 +128,11 @@ ClearVram:
StopAllSounds::
- ld a, BANK(Audio1_UpdateMusic)
+ ld a, BANK(AudioEngine1)
ld [wAudioROMBank], a
ld [wAudioSavedROMBank], a
xor a
ld [wAudioFadeOutControl], a
ld [wNewSoundID], a
ld [wLastMusicSoundID], a
- dec a
- jp PlaySound
+ jp StopAllMusic
diff --git a/home/joypad.asm b/home/joypad.asm
deleted file mode 100644
index 2002bb29..00000000
--- a/home/joypad.asm
+++ /dev/null
@@ -1,39 +0,0 @@
-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
-
- ld [rJOYP], a
- rept 6
- ld a, [rJOYP]
- endr
- cpl
- and %1111
- swap a
- ld b, a
-
- ld a, 1 << 4 ; select button keys
- ld [rJOYP], a
- rept 10
- ld a, [rJOYP]
- endr
- cpl
- and %1111
- or b
-
- ld [hJoyInput], a
-
- ld a, 1 << 4 + 1 << 5 ; deselect keys
- ld [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
diff --git a/home/lcdc.asm b/home/lcdc.asm
new file mode 100644
index 00000000..6172dd0d
--- /dev/null
+++ b/home/lcdc.asm
@@ -0,0 +1,20 @@
+LCDC::
+ push af
+ ld a, [hLCDCPointer] ; doubles as enabling byte
+ and a
+ jr z, .noLCDCInterrupt
+ push hl
+ ; [C700 + [rLY]] --> [FF00 + [hLCDCPointer]]
+ ld a, [rLY]
+ ld l, a
+ ld h, wLYOverrides / $100
+ ld h, [hl] ; h != not part of pointer
+ ld a, [hLCDCPointer]
+ ld l, a
+ ld a, h
+ ld h, $ff
+ ld [hl], a
+ pop hl
+.noLCDCInterrupt
+ pop af
+ reti
diff --git a/home/overworld.asm b/home/overworld.asm
index b96efcb4..8608cbfe 100644
--- a/home/overworld.asm
+++ b/home/overworld.asm
@@ -1,8 +1,3 @@
-HandleMidJump::
-; Handle the player jumping down
-; a ledge in the overworld.
- jpba _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]
callba EnterMapAnim
call UpdateSprites
+ ld hl, wd732
+ res 3, [hl]
+ ld hl, wd72e
+ res 4, [hl]
.didNotEnterUsingFlyWarpOrDungeonWarp
+ call IsSurfingPikachuInParty
callba 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::
ld a, [$ffeb]
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
ld 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 [wSpriteStateData1 + 5], a ; delta X
-
+ 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
+ callab Func_fcc08
jr .moveAhead2
.moveAhead
- ld a, [wd736]
- bit 7, a
- jr z, .noSpinning
- callba 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
callba SafariZoneCheckSteps
ld a, [wSafariZoneGameOver]
@@ -346,12 +289,31 @@ OverworldLoopLessDelay::
callab 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
+ callab 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]
+ callab SetPikachuSpawnWarpPad
jr .done
+
.goBackOutside
+ callab 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
; $C2XE without loading any tile patterns.
- callba 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
aCoord 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,15 @@ HandleBlackOut::
call StopMusic
ld hl, wd72e
res 5, [hl]
- ld a, Bank(ResetStatusAndHalveMoneyOnBlackout) ; also Bank(SpecialWarpIn) and Bank(SpecialEnterMap)
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
- call ResetStatusAndHalveMoneyOnBlackout
+ switchbank SpecialWarpIn ; also Bank(SpecialEnterMap)
+ callab ResetStatusAndHalveMoneyOnBlackout
call SpecialWarpIn
call PlayDefaultMusicFadeOutCurrent
jp SpecialEnterMap
StopMusic::
ld [wAudioFadeOutControl], a
- ld a, $ff
- ld [wNewSoundID], a
- call PlaySound
+ call StopAllMusic
.wait
ld a, [wAudioFadeOutControl]
and a
@@ -786,22 +763,31 @@ 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
- ld a, Bank(SpecialWarpIn)
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
- call SpecialWarpIn
+ call Func_07c4
+ callbs SpecialWarpIn
jp SpecialEnterMap
LeaveMapAnim::
jpba _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 +823,7 @@ LoadPlayerSpriteGraphics::
dec a
jp z, LoadBikePlayerSpriteGraphics
dec a
- jp z, LoadSurfingPlayerSpriteGraphics
+ jp z, LoadSurfingPlayerSpriteGraphics2
jp LoadWalkingPlayerSpriteGraphics
IsBikeRidingAllowed::
@@ -878,23 +864,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 +1052,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
ld [hSpriteIndexOrTextID], a
@@ -1083,39 +1061,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]
- ld [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,13 +1076,12 @@ 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::
lb bc, $3c, $40 ; Y and X position of player sprite
- ld a, [wSpriteStateData1 + 9] ; direction the player is facing
+ ld a, [wSpritePlayerStateData1FacingDirection] ; direction the player is facing
.checkIfPlayerFacingUp
cp SPRITE_FACING_UP
jr nz, .checkIfPlayerFacingDown
@@ -1172,13 +1120,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, wSpriteStateData1 + $10
- 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 +1149,9 @@ IsSpriteInFrontOfPlayer2::
inc e
dec d
jr nz, .spriteLoop
+ xor a
ret
+
.foundSpriteInFrontOfPlayer
pop hl
ld a, l
@@ -1214,6 +1161,52 @@ IsSpriteInFrontOfPlayer2::
set 7, [hl] ; set flag to make the sprite face the player
ld a, e
ld [hSpriteIndexOrTextID], a
+ ld 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]
+ ld [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 +1223,31 @@ CollisionCheckOnLand::
ld d, a
ld a, [wSpriteStateData1 + 12] ; the player sprite's collision data (bit field) (set in the sprite movement code)
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
ld [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]
ld 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
+ ld 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 +1272,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
@@ -1286,7 +1284,7 @@ CheckForJumpingAndTilePairCollisions::
predef GetTileAndCoordsInFrontOfPlayer ; get the tile in front of the player
push de
push bc
- callba HandleLedges ; check if the player is trying to jump a ledge
+ callba HandleLedges ; check if the player is trying to jump a ledge
pop bc
pop de
pop hl
@@ -1375,8 +1373,7 @@ LoadCurrentMapView::
ld a, [H_LOADEDROMBANK]
push af
ld a, [wTilesetBank] ; tile data ROM bank
- ld [H_LOADEDROMBANK], 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]
@@ -1457,254 +1454,19 @@ LoadCurrentMapView::
dec b
jr nz, .rowLoop2
pop af
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a ; restore previous ROM bank
+ call BankswitchCommon ; restore previous ROM bank
ret
AdvancePlayerSprite::
- ld a, [wSpriteStateData1 + 3] ; delta Y
- ld b, a
- ld a, [wSpriteStateData1 + 5] ; delta X
- 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, [wSpriteStateData1 + 3] ; delta Y
- 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, [wSpriteStateData1 + 5] ; delta X
- 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, [wSpriteStateData1 + 3] ; delta Y
- ld b, a
- ld a, [wSpriteStateData1 + 5] ; delta X
- ld c, a
- sla b
- sla c
- ld a, [hSCY]
- add b
- ld [hSCY], a ; update background scroll Y
- ld a, [hSCX]
- add c
- ld [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, wSpriteStateData1 + $14
- 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
+ ld hl, _AdvancePlayerSprite
+ ld b, BANK(_AdvancePlayerSprite)
+ call Bankswitch
+ pop af
+ ld [wUpdateSpritesEnabled], a
ret
; the following 6 functions are used to tell the V-blank handler to redraw
@@ -1849,18 +1611,25 @@ JoypadOverworld::
ld [wSpriteStateData1 + 5], 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
ld a, [hJoyHeld]
and D_DOWN | D_UP | D_LEFT | D_RIGHT | B_BUTTON | A_BUTTON
- jr nz, .notForcedDownwards
+ ret nz
ld a, D_DOWN
ld [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
@@ -1870,18 +1639,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
ld [hJoyHeld], a ; store simulated button press in joypad state
and a
ret nz
@@ -1905,15 +1664,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
@@ -1922,31 +1696,17 @@ CollisionCheckOnWater::
ld d, a
ld a, [wSpriteStateData1 + 12] ; the player sprite's collision data (bit field) (set in the sprite movement code)
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])
+ callab 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
@@ -1956,21 +1716,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::
@@ -2000,24 +1765,46 @@ 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(RedCyclingSprite)
ld de, RedCyclingSprite
- 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
@@ -2027,12 +1814,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::
callba MarkTownVisitedAndLoadMissableObjects
+ jr asm_0dbd
+
+Func_0db5:: ; XXX
+ callba LoadUnusedBluesHouseMissableObjectData
+asm_0dbd
ld a, [wCurMapTileset]
ld [wUnusedD119], a
ld a, [wCurMap]
@@ -2044,20 +1836,7 @@ LoadMapHeader::
ld [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
@@ -2131,155 +1910,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
- ld [hSignCoordPointer], a
- ld a, e
- ld [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
- ld a, [hSignCoordPointer]
- ld d, a
- ld a, [hSignCoordPointer + 1]
- ld e, a
- ld a, [hli]
- ld [de], a
- inc de
- ld a, d
- ld [hSignCoordPointer], a
- ld a, e
- ld [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 C110-C1FF and C210-C2FF
- ld hl, wSpriteStateData1 + $10
- ld de, wSpriteStateData2 + $10
- xor a
- ld b, $f0
-.zeroSpriteDataLoop
- ld [hli], a
- ld [de], a
- inc e
- dec b
- jr nz, .zeroSpriteDataLoop
-; initialize all C100-C1FF sprite entries to disabled (other than player's)
- ld hl, wSpriteStateData1 + $12
- ld de, $0010
- ld c, $0f
-.disableSpriteEntriesLoop
- ld [hl], $ff
- add hl, de
- dec c
- jr nz, .disableSpriteEntriesLoop
- pop hl
- ld de, wSpriteStateData1 + $10
- 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 ; store picture ID at C1X0
- inc d
- ld a, $04
- add e
- ld e, a
- ld a, [hli]
- ld [de], a ; store Y position at C2X4
- inc e
- ld a, [hli]
- ld [de], a ; store X position at C2X5
- inc e
- ld a, [hli]
- ld [de], a ; store movement byte 1 at C2X6
- ld a, [hli]
- ld [hLoadSpriteTemp1], a ; save movement byte 2
- ld a, [hli]
- ld [hLoadSpriteTemp2], a ; save text ID and flags byte
- push bc
- push hl
- ld b, $00
- ld hl, wMapSpriteData
- add hl, bc
- ld a, [hLoadSpriteTemp1]
- ld [hli], a ; store movement byte 2 in byte 0 of sprite entry
- ld a, [hLoadSpriteTemp2]
- ld [hl], a ; this appears pointless, since the value is overwritten immediately after
- ld a, [hLoadSpriteTemp2]
- ld [hLoadSpriteTemp1], a
- and $3f
- ld [hl], a ; store text ID in byte 1 of sprite entry
- pop hl
- ld a, [hLoadSpriteTemp1]
- bit 6, a
- jr nz, .trainerSprite
- bit 7, a
- jr nz, .itemBallSprite
- jr .regularSprite
-.trainerSprite
- ld a, [hli]
- ld [hLoadSpriteTemp1], a ; save trainer class
- ld a, [hli]
- ld [hLoadSpriteTemp2], a ; save trainer number (within class)
- push hl
- ld hl, wMapSpriteExtraData
- add hl, bc
- ld a, [hLoadSpriteTemp1]
- ld [hli], a ; store trainer class in byte 0 of the entry
- ld a, [hLoadSpriteTemp2]
- ld [hl], a ; store trainer number in byte 1 of the entry
- pop hl
- jr .nextSprite
-.itemBallSprite
- ld a, [hli]
- ld [hLoadSpriteTemp1], a ; save item number
- push hl
- ld hl, wMapSpriteExtraData
- add hl, bc
- ld 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
+ callab SchedulePikachuSpawnForAfterText
+.skip_pika_spawn
callab 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
@@ -2293,9 +1936,7 @@ LoadMapHeader::
ld b, $00
ld a, [H_LOADEDROMBANK]
push af
- ld a, BANK(MapSongBanks)
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
+ switchbank MapSongBanks
ld hl, MapSongBanks
add hl, bc
add hl, bc
@@ -2304,8 +1945,7 @@ LoadMapHeader::
ld a, [hl]
ld [wMapMusicROMBank], a ; music 2
pop af
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
+ call BankswitchCommon
ret
; function to copy map connection data from ROM to WRAM
@@ -2320,11 +1960,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::
ld a, [H_LOADEDROMBANK]
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::
+ ld a, [H_LOADEDROMBANK]
+ 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 asm_0f4d
+
+ReloadMapAfterPrinter::
+ ld a, [H_LOADEDROMBANK]
+ push af
+ ld a, [wCurMap]
+ call SwitchToMapRomBank
+ call LoadTileBlockMap
+ pop af
+ call BankswitchCommon
+asm_0f4d:
+ jpab SetMapSpecificScriptFlagsOnMapReload
+ ret ; useless?
+
+ResetMapVariables::
ld a, $98
ld [wMapViewVRAMPointer + 1], a
xor a
@@ -2333,17 +2054,15 @@ LoadMapData::
ld [hSCX], a
ld [wWalkCounter], a
ld [wUnusedD119], a
- ld [wWalkBikeSurfStateCopy], a
ld [wSpriteSetID], a
- call LoadTextBoxTilePatterns
- call LoadMapHeader
- callba InitMapSprites ; load tile pattern data for sprites
- call LoadTileBlockMap
- call LoadTilesetTilePatternData
- call LoadCurrentMapView
+ ld [wWalkBikeSurfStateCopy], a
+ ret
+
+CopyMapViewToVRAM::
; copy current map view to VRAM
- coord hl, 0, 0
ld de, vBGMap0
+CopyMapViewToVRAM2:
+ ld hl, wTileMap
ld b, 18
.vramCopyLoop
ld c, 20
@@ -2353,7 +2072,7 @@ LoadMapData::
inc e
dec c
jr nz, .vramCopyInnerLoop
- ld a, 32 - 20
+ ld a, 32 - 20 ; total vram map width in tiles - screen width in tiles
add e
ld e, a
jr nc, .noCarry
@@ -2361,24 +2080,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
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
ret
; function to switch to the ROM bank that a map is stored in
@@ -2388,20 +2089,37 @@ SwitchToMapRomBank::
push bc
ld c, a
ld b, $00
- ld a, Bank(MapHeaderBanks)
- call BankswitchHome ; switch to ROM bank 3
+ ld a, BANK(MapHeaderBanks)
+ call BankswitchHome ; switch to ROM bank 3F
ld hl, MapHeaderBanks
add hl, bc
ld a, [hl]
ld [$ffe8], a ; save map ROM bank
call BankswitchBack
ld a, [$ffe8]
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a ; switch to map ROM bank
+ call BankswitchCommon
pop bc
pop hl
ret
+GetMapHeaderPointer::
+ ld a, [H_LOADEDROMBANK]
+ push af
+ switchbank MapHeaderPointers
+ 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
@@ -2421,3 +2139,160 @@ ForceBikeOrSurf::
ld hl, LoadPlayerSpriteGraphics
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
+ callba _HandleMidJump
+ ret
+
+IsSpinning::
+ ld a, [wd736]
+ bit 7, a
+ ret z ; no spinning
+ jpba LoadSpinnerArrowTiles ; spin while moving
+
+Func_0ffe::
+ jpab 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, wSpriteStateData1 + $10
+; copy sprite stuff?
+.loadSpriteLoop
+ ld a, [hli]
+ ld [de], a ; store picture ID at C1X0
+ inc d
+ ld a, e
+ add $4
+ ld e, a
+ ld a, [hli]
+ ld [de], a ; store Y position at C2X4
+ inc e
+ ld a, [hli]
+ ld [de], a ; store X position at C2X5
+ inc e
+ ld a, [hli]
+ ld [de], a ; store movement byte 1 at C2X6
+ ld a, [hli]
+ ld [$ff8d], a ; save movement byte 2
+ ld a, [hli]
+ ld [$ff8e], 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 C110-C1EF and C210-C2EF
+; C1F0-C1FF and C2F0-C2FF is used for Pikachu
+ ld hl, wSpriteStateData1 + $10
+ ld de, wSpriteStateData2 + $10
+ xor a
+ ld b, 14 * $10
+.loop
+ ld [hli], a
+ ld [de], a
+ inc e
+ dec b
+ jr nz, .loop
+ ret
+
+DisableRegularSprites::
+; initialize all C100-C1FF sprite entries to disabled (other than player's and pikachu)
+ ld hl, wSpriteStateData1 + 1 * $10 + 2
+ 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
+ ld a, [$ff8d]
+ ld [hli], a ; store movement byte 2 in byte 0 of sprite entry
+ ld a, [$ff8e]
+ ld [hl], a ; this appears pointless, since the value is overwritten immediately after
+ ld a, [$ff8e]
+ ld [$ff8d], a
+ and $3f
+ ld [hl], a ; store text ID in byte 1 of sprite entry
+ pop hl
+ ld a, [$ff8d]
+ 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]
+ ld [$ff8d], a ; save trainer class
+ ld a, [hli]
+ ld [$ff8e], a ; save trainer number (within class)
+ push hl
+ ld hl, wMapSpriteExtraData
+ add hl, bc
+ ld a, [$ff8d]
+ ld [hli], a ; store trainer class in byte 0 of the entry
+ ld a, [$ff8e]
+ ld [hl], a ; store trainer number in byte 1 of the entry
+ pop hl
+ ret
+
+.itemBallSprite
+ ld a, [hli]
+ ld [$ff8d], a ; save item number
+ push hl
+ ld hl, wMapSpriteExtraData
+ add hl, bc
+ ld a, [$ff8d]
+ 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
diff --git a/home/pic.asm b/home/pic.asm
index a1c18e8a..236efe9d 100644
--- a/home/pic.asm
+++ b/home/pic.asm
@@ -5,16 +5,13 @@ UncompressSpriteData::
ld a, [H_LOADEDROMBANK]
push af
ld a, b
- ld [H_LOADEDROMBANK], 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
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
+ call BankswitchCommon
ret
; initializes necessary data to load a sprite and runs UncompressSpriteDataLoop
diff --git a/home/pikachu.asm b/home/pikachu.asm
new file mode 100755
index 00000000..336c80b3
--- /dev/null
+++ b/home/pikachu.asm
@@ -0,0 +1,114 @@
+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
+ ld [hTilePlayerStandingOn], a
+ homecall SpawnPikachu_ ; 3f:46d5
+ 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
+ ld a, [H_LOADEDROMBANK]
+ 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::
+ ld a, [H_LOADEDROMBANK]
+ ld b, a
+ push af
+ callbs ApplyPikachuMovementData_
+ pop af
+ call BankswitchCommon
+ ret
diff --git a/engine/play_time.asm b/home/play_time.asm
index a5202cc6..47b2a690 100755..100644
--- a/engine/play_time.asm
+++ b/home/play_time.asm
@@ -1,7 +1,10 @@
TrackPlayTime:
call CountDownIgnoreInputBitReset
- ld a, [wd732]
- bit 0, a
+ ld hl, wd47a
+ bit 0, [hl]
+ jr nz, .maxIGT
+ ld a,[wd732]
+ bit 0,a
ret z
ld a, [wPlayTimeMaxed]
and a
@@ -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/predef.asm b/home/predef.asm
index 9bb9be74..dfa10772 100644
--- a/home/predef.asm
+++ b/home/predef.asm
@@ -19,8 +19,7 @@ Predef::
call GetPredefPointer
ld a, [wPredefBank]
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
+ call BankswitchCommon
ld de, .done
push de
@@ -28,8 +27,7 @@ Predef::
.done
pop af
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
+ call BankswitchCommon
ret
GetPredefRegisters::
diff --git a/home/serial.asm b/home/serial.asm
index 6c412239..5fe7fb81 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__
ld a, [hSerialConnectionStatus]
inc a
jr z, .connectionNotYetEstablished
@@ -310,3 +313,11 @@ Serial_TryEstablishingExternallyClockedConnection::
ld a, START_TRANSFER_EXTERNAL_CLOCK
ld [rSC], a
ret
+
+PrinterSerial__::
+ call PrinterSerial
+ pop hl
+ pop de
+ pop bc
+ pop af
+ reti
diff --git a/home/text.asm b/home/text.asm
index 9db81530..f78227eb 100644
--- a/home/text.asm
+++ b/home/text.asm
@@ -62,7 +62,7 @@ Char4ETest::
cp $4E ; next
jr nz, .char4FTest
ld bc, 2 * SCREEN_WIDTH
- ld a, [hFlags_0xFFF6]
+ ld a, [hFlags_0xFFFA]
bit 2, a
jr z, .ok
ld bc, SCREEN_WIDTH
@@ -228,7 +228,7 @@ Char56Text::
Char5AText::
db "Enemy @"
Char4AText::
- db $E1,$E2,"@" ; PKMN
+ db $E1, $E2, "@" ; PKMN
Char55::
push de
@@ -289,6 +289,13 @@ Char51:: ; para
jp PlaceNextChar_inc
Char49::
+ ld a, [hFlags_0xFFFA]
+ bit 3, a
+ jr z, .Char49
+ ld a, $4e
+ jp Char4ETest
+
+.Char49
push de
ld a, "▼"
Coorda 18, 16
@@ -365,7 +372,7 @@ TextCommandProcessor::
push af
set 1, a
ld e, a
- ld a, [$fff4]
+ ld a, [$fff9]
xor e
ld [wLetterPrintingDelayFlags], a
ld a, c
@@ -554,7 +561,7 @@ TextCommand09::
ld a, b
and $f0
swap a
- set BIT_LEFT_ALIGN,a
+ set BIT_LEFT_ALIGN, a
ld b, a
call PrintNumber
ld b, h
@@ -619,14 +626,14 @@ TextCommand0B::
; format: text command ID, sound ID or cry ID
TextCommandSounds::
- db $0B, SFX_GET_ITEM_1 ; actually plays SFX_LEVEL_UP when the battle music engine is loaded
- db $12, SFX_CAUGHT_MON
- db $0E, SFX_POKEDEX_RATING ; unused?
- db $0F, SFX_GET_ITEM_1 ; unused?
+ db $0B, SFX_GET_ITEM_1
+ db $12, SFX_TURN_OFF_PC
+ db $0E, SFX_POKEDEX_RATING
+ db $0F, SFX_GET_ITEM_1
db $10, SFX_GET_ITEM_2
db $11, SFX_GET_KEY_ITEM
- db $13, SFX_DEX_PAGE_ADDED
- db $14, NIDORINA ; used in OakSpeech
+ db $13, SFX_TRADE_MACHINE
+ db $14, PIKACHU ; used in OakSpeech
db $15, PIDGEOT ; used in SaffronCityText12
db $16, DEWGONG ; unused?
diff --git a/home/vblank.asm b/home/vblank.asm
index e80fba75..764e5277 100644
--- a/home/vblank.asm
+++ b/home/vblank.asm
@@ -5,6 +5,11 @@ VBlank::
push de
push hl
+ ld a, [rVBK] ; vram bank
+ push af
+ xor a
+ ld [rVBK], a ; reset vram bank to 0
+
ld a, [H_LOADEDROMBANK]
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
ld a, [H_VBLANKOCCURRED]
and a
@@ -52,36 +59,18 @@ VBlank::
.skipDec
call FadeOutAudio
- ld a, [wAudioROMBank] ; music ROM bank
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
+ callbs Music_DoLowHealthAlarm
+ callbs Audio1_UpdateMusic
- cp BANK(Audio1_UpdateMusic)
- jr nz, .checkForAudio2
-.audio1
- call Audio1_UpdateMusic
- jr .afterMusic
-.checkForAudio2
- cp BANK(Audio2_UpdateMusic)
- jr nz, .audio3
-.audio2
- call Music_DoLowHealthAlarm
- call Audio2_UpdateMusic
- jr .afterMusic
-.audio3
- call Audio3_UpdateMusic
-.afterMusic
-
- callba TrackPlayTime ; keep track of time played
-
- ld a, [hDisableJoypadPolling]
- and a
- call z, ReadJoypad
+ call SerialFunction
ld a, [wVBlankSavedROMBank]
ld [H_LOADEDROMBANK], a
ld [MBC1RomBank], a
+ pop af
+ ld [rVBK],a
+
pop hl
pop de
pop bc
diff --git a/home/vcopy.asm b/home/vcopy.asm
index 3f49ad3e..bec679c4 100644
--- a/home/vcopy.asm
+++ b/home/vcopy.asm
@@ -123,11 +123,7 @@ AutoBgMapTransfer::
ld a, [H_AUTOBGTRANSFERENABLED]
and a
ret z
- ld hl, sp + 0
- ld a, h
- ld [H_SPTEMP], a
- ld a, l
- ld [H_SPTEMP + 1], a ; save stack pinter
+ ld [H_SPTEMP], sp ; save stack pointer
ld a, [H_AUTOBGTRANSFERPORTION]
and a
jr z, .transferTopThird
@@ -193,9 +189,9 @@ TransferBgRows::
jr nz, TransferBgRows
ld a, [H_SPTEMP]
- ld h, a
- ld a, [H_SPTEMP + 1]
ld l, a
+ ld a, [H_SPTEMP + 1]
+ ld h, a
ld sp, hl
ret
@@ -205,11 +201,7 @@ VBlankCopyBgMap::
ld a, [H_VBCOPYBGSRC] ; doubles as enabling byte
and a
ret z
- ld hl, sp + 0
- ld a, h
- ld [H_SPTEMP], a
- ld a, l
- ld [H_SPTEMP + 1], a ; save stack pointer
+ ld [H_SPTEMP], sp ; save stack pointer
ld a, [H_VBCOPYBGSRC]
ld l, a
ld a, [H_VBCOPYBGSRC + 1]
@@ -238,11 +230,7 @@ VBlankCopyDouble::
and a
ret z
- ld hl, sp + 0
- ld a, h
- ld [H_SPTEMP], a
- ld a, l
- ld [H_SPTEMP + 1], a
+ ld [H_SPTEMP], sp ; save stack pointer
ld a, [H_VBCOPYDOUBLESRC]
ld l, a
@@ -285,21 +273,14 @@ VBlankCopyDouble::
dec b
jr nz, .loop
- ld a, l
- ld [H_VBCOPYDOUBLEDEST], a
- ld a, h
- ld [H_VBCOPYDOUBLEDEST + 1], a
-
- ld hl, sp + 0
- ld a, l
- ld [H_VBCOPYDOUBLESRC], a
- ld a, h
- ld [H_VBCOPYDOUBLESRC + 1], a
+ ld [H_VBCOPYDOUBLESRC], sp
+ ld sp, hl ; load destination into sp to save time with ld [$xxxx], sp
+ ld [H_VBCOPYDOUBLEDEST], sp
ld a, [H_SPTEMP]
- ld h, a
- ld a, [H_SPTEMP + 1]
ld l, a
+ ld a, [H_SPTEMP + 1]
+ ld h, a
ld sp, hl
ret
@@ -316,11 +297,7 @@ VBlankCopy::
and a
ret z
- ld hl, sp + 0
- ld a, h
- ld [H_SPTEMP], a
- ld a, l
- ld [H_SPTEMP + 1], a
+ ld [H_SPTEMP], sp
ld a, [H_VBCOPYSRC]
ld l, a
@@ -355,21 +332,14 @@ VBlankCopy::
dec b
jr nz, .loop
- ld a, l
- ld [H_VBCOPYDEST], a
- ld a, h
- ld [H_VBCOPYDEST + 1], a
-
- ld hl, sp + 0
- ld a, l
- ld [H_VBCOPYSRC], a
- ld a, h
- ld [H_VBCOPYSRC + 1], a
+ ld [H_VBCOPYSRC], sp
+ ld sp, hl
+ ld [H_VBCOPYDEST], sp
ld a, [H_SPTEMP]
- ld h, a
- ld a, [H_SPTEMP + 1]
ld l, a
+ ld a, [H_SPTEMP + 1]
+ ld h, a
ld sp, hl
ret
@@ -383,6 +353,10 @@ UpdateMovingBgTiles::
and a
ret z ; no animations if indoors (or if a menu set this to 0)
+ ld a,[rLY]
+ cp $90 ; check if not in vblank period??? (maybe if vblank is too long)
+ ret c
+
ld a, [hMovingBGTilesCounter1]
inc a
ld [hMovingBGTilesCounter1], a
diff --git a/hram.asm b/hram.asm
index 4beca9c4..0e1fae7e 100644
--- a/hram.asm
+++ b/hram.asm
@@ -16,8 +16,6 @@ hWarpDestinationMap EQU $FF8B
hOAMTile EQU $FF8B
-hROMBankTemp EQU $FF8B
-
hPreviousTileset EQU $FF8B
hEastWestConnectedMapWidth EQU $FF8B
@@ -272,6 +270,8 @@ H_CURRENTSPRITEOFFSET EQU $FFDA ; multiple of $10
hItemCounter EQU $FFDB
+hCanceledPrinting EQU $FFDB
+
hGymGateIndex EQU $FFDB
hGymTrashCanRandNumMask EQU $FFDB
@@ -310,15 +310,24 @@ hCoordsInFrontOfPlayerMatch EQU $FFEA
hSpriteAnimFrameCounter EQU $FFEA
+hItemAlreadyFound EQU $FFEB
+
+hDidntFindAnyHiddenObject EQU $FFEE
+
H_WHOSETURN EQU $FFF3 ; 0 on player’s turn, 1 on enemy’s turn
+hLCDCPointer EQU $FFF4
+
+hJoyInput EQU $FFF5
+
+hDisableJoypadPolling EQU $FFF8 ; non-zero value disables polling of joypad
+
; bit 0: draw HP fraction to the right of bar instead of below (for party menu)
; bit 1: menu is double spaced
-hFlags_0xFFF6 EQU $FFF6
-
-hFieldMoveMonMenuTopMenuItemX EQU $FFF7
+hFlags_0xFFFA EQU $FFFA
-hDisableJoypadPolling EQU $FFF9
+hFieldMoveMonMenuTopMenuItemX EQU $FFFB
-hJoyInput EQU $FFF8
+h_0xFFFC EQU $FFFC
+hGBC EQU $FFFE ; 0 if DMG, != 0 if GBC
diff --git a/macros.asm b/macros.asm
index b779ec5f..db13fec6 100644
--- a/macros.asm
+++ b/macros.asm
@@ -3,3 +3,105 @@ INCLUDE "macros/data_macros.asm"
INCLUDE "macros/text_macros.asm"
INCLUDE "macros/audio_macros.asm"
INCLUDE "macros/event_macros.asm"
+
+SHADE_BLACK EQU %11
+SHADE_DARK EQU %10
+SHADE_LIGHT EQU %01
+SHADE_WHITE EQU %00
+
+setpal: MACRO
+ ld a, \1 << 6 | \2 << 4 | \3 << 2 | \4
+ENDM
+
+setpalBGP: MACRO
+ setpal SHADE_BLACK, SHADE_DARK, SHADE_LIGHT, SHADE_WHITE
+ENDM
+
+setpalOBP: MACRO
+ setpal SHADE_BLACK, SHADE_DARK, SHADE_WHITE, SHADE_WHITE
+ENDM
+
+homecall_jump: MACRO
+ ld a, [H_LOADEDROMBANK]
+ push af
+ ld a, BANK(\1)
+ call BankswitchCommon
+ call \1
+ pop af
+ jp BankswitchCommon
+ ENDM
+
+homecall_jump_sf: MACRO
+ ld a, [H_LOADEDROMBANK]
+ push af
+ ld a, BANK(\1)
+ call BankswitchCommon
+ call \1
+ pop bc
+ ld a,b
+ jp BankswitchCommon
+ ENDM
+
+homecall_sf: MACRO ; homecall but save flags by popping into bc instead of af
+ ld a, [H_LOADEDROMBANK]
+ push af
+ ld a, BANK(\1)
+ call BankswitchCommon
+ call \1
+ pop bc
+ ld a,b
+ call BankswitchCommon
+ ENDM
+
+switchbank: MACRO
+ ld a, BANK(\1)
+ call BankswitchCommon
+ ENDM
+
+callbs: MACRO
+ ld a, BANK(\1)
+ call BankswitchCommon
+ call \1
+ 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
+
+sine_wave: MACRO
+; \1: amplitude
+
+x = 0
+ rept $20
+ ; Round up.
+ dw (sin(x) + (sin(x) & $ff)) >> 8
+x = x + (\1) * $40000
+ endr
+ENDM
+
+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 EQU $b
+ANIM_OBJ_FIELD_C EQU $c
+ANIM_OBJ_FIELD_D EQU $d
+ANIM_OBJ_FIELD_E EQU $e
+ANIM_OBJ_FIELD_F EQU $f
diff --git a/macros/asm_macros.asm b/macros/asm_macros.asm
index d3f00b0c..7012d7e1 100755
--- a/macros/asm_macros.asm
+++ b/macros/asm_macros.asm
@@ -7,12 +7,10 @@ homecall: MACRO
ld a, [H_LOADEDROMBANK]
push af
ld a, BANK(\1)
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
+ call BankswitchCommon
call \1
pop af
- ld [H_LOADEDROMBANK], a
- ld [MBC1RomBank], a
+ call BankswitchCommon
ENDM
farcall EQUS "callba"
diff --git a/macros/audio_macros.asm b/macros/audio_macros.asm
index 95b9ecbc..6daadbc6 100755
--- a/macros/audio_macros.asm
+++ b/macros/audio_macros.asm
@@ -1,8 +1,8 @@
-StopAllMusic: MACRO
- ld a, $ff
- call PlaySound
-ENDM
+;StopAllMusic: MACRO
+; ld a, $ff
+; call PlaySound
+;ENDM
Ch1 EQU 0
Ch2 EQU 1
diff --git a/macros/event_macros.asm b/macros/event_macros.asm
index 20027209..a3ce9746 100755..100644
--- a/macros/event_macros.asm
+++ b/macros/event_macros.asm
@@ -57,6 +57,16 @@ event_byte = ((\2) / 8)
ld \1, wEventFlags + event_byte
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)
@@ -125,6 +135,27 @@ CheckAndResetEventA: MACRO
ld [wEventFlags + ((\1) / 8)], a
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)
@@ -431,6 +462,36 @@ CheckEitherEventSet: MACRO
ENDC
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/main.asm b/main.asm
index da4e691d..1c8efc31 100755
--- a/main.asm
+++ b/main.asm
@@ -1,16 +1,5 @@
INCLUDE "constants.asm"
-NPC_SPRITES_1 EQU $4
-NPC_SPRITES_2 EQU $5
-
-GFX EQU $4
-
-PICS_1 EQU $9
-PICS_2 EQU $A
-PICS_3 EQU $B
-PICS_4 EQU $C
-PICS_5 EQU $D
-
INCLUDE "home.asm"
@@ -18,12 +7,6 @@ SECTION "bank1", ROMX
INCLUDE "data/facing.asm"
-INCLUDE "engine/black_out.asm"
-
-MewPicFront:: INCBIN "pic/bmon/mew.pic"
-MewPicBack:: INCBIN "pic/monback/mewb.pic"
-INCLUDE "data/baseStats/mew.asm"
-
INCLUDE "engine/battle/safari_zone.asm"
INCLUDE "engine/titlescreen.asm"
@@ -34,14 +17,11 @@ INCLUDE "text/item_names.asm"
INCLUDE "text/unused_names.asm"
INCLUDE "engine/overworld/oam.asm"
-INCLUDE "engine/oam_dma.asm"
INCLUDE "engine/print_waiting_text.asm"
INCLUDE "engine/overworld/map_sprite_functions1.asm"
-INCLUDE "engine/test_battle.asm"
-
INCLUDE "engine/overworld/item.asm"
INCLUDE "engine/overworld/movement.asm"
@@ -91,10 +71,6 @@ SECTION "bank3", ROMX
INCLUDE "engine/joypad.asm"
-INCLUDE "data/map_songs.asm"
-
-INCLUDE "data/map_header_banks.asm"
-
INCLUDE "engine/overworld/clear_variables.asm"
INCLUDE "engine/overworld/player_state.asm"
INCLUDE "engine/overworld/poison.asm"
@@ -103,10 +79,6 @@ INCLUDE "engine/overworld/daycare_exp.asm"
INCLUDE "data/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/items.asm"
@@ -129,6 +101,42 @@ INCLUDE "engine/hp_bar.asm"
INCLUDE "engine/hidden_object_functions3.asm"
+SECTION "Graphics (BANK 4)", ROMX
+
+PokemonLogoJapanGraphics: INCBIN "gfx/pokemon_logo_japan.2bpp"
+FontGraphics: INCBIN "gfx/font.1bpp"
+FontGraphicsEnd:
+ABTiles: INCBIN "gfx/AB.2bpp"
+HpBarAndStatusGraphics: INCBIN "gfx/hp_bar_and_status.2bpp"
+HpBarAndStatusGraphicsEnd:
+BattleHudTiles1: INCBIN "gfx/battle_hud1.1bpp"
+BattleHudTiles1End:
+BattleHudTiles2: INCBIN "gfx/battle_hud2.1bpp"
+BattleHudTiles3: INCBIN "gfx/battle_hud3.1bpp"
+BattleHudTiles3End:
+NintendoCopyrightLogoGraphics: INCBIN "gfx/copyright.2bpp"
+GamefreakLogoGraphics: INCBIN "gfx/gamefreak.2bpp"
+GamefreakLogoGraphicsEnd:
+NineTile: INCBIN "gfx/9_tile.2bpp"
+TextBoxGraphics: INCBIN "gfx/text_box.2bpp"
+TextBoxGraphicsEnd:
+PokedexTileGraphics: INCBIN "gfx/pokedex.2bpp"
+PokedexTileGraphicsEnd:
+WorldMapTileGraphics: INCBIN "gfx/town_map.2bpp"
+WorldMapTileGraphicsEnd:
+PlayerCharacterTitleGraphics: INCBIN "gfx/player_title.2bpp"
+
+INCLUDE "engine/menu/status_screen.asm"
+INCLUDE "engine/menu/party_menu.asm"
+
+RedPicFront: INCBIN "pic/ytrainer/red.pic"
+ShrinkPic1: INCBIN "pic/trainer/shrink1.pic"
+ShrinkPic2: INCBIN "pic/trainer/shrink2.pic"
+
+INCLUDE "engine/menu/start_sub_menus.asm"
+INCLUDE "engine/items/tms.asm"
+
+
SECTION "NPC Sprites 1", ROMX ; BANK $04
OakAideSprite: INCBIN "gfx/sprites/oak_aide.2bpp"
@@ -158,58 +166,20 @@ ClipboardSprite: INCBIN "gfx/sprites/clipboard.2bpp"
SnorlaxSprite: INCBIN "gfx/sprites/snorlax.2bpp"
OldAmberSprite: INCBIN "gfx/sprites/old_amber.2bpp"
LyingOldManSprite: INCBIN "gfx/sprites/lying_old_man.2bpp"
+QuestionMarkSprite: INCBIN "gfx/sprites/question_mark.2bpp"
-
-SECTION "Graphics (BANK 4)", ROMX
-
-PokemonLogoGraphics: INCBIN "gfx/pokemon_logo.2bpp"
-FontGraphics: INCBIN "gfx/font.1bpp"
-FontGraphicsEnd:
-ABTiles: INCBIN "gfx/AB.2bpp"
-HpBarAndStatusGraphics: INCBIN "gfx/hp_bar_and_status.2bpp"
-HpBarAndStatusGraphicsEnd:
-BattleHudTiles1: INCBIN "gfx/battle_hud1.1bpp"
-BattleHudTiles1End:
-BattleHudTiles2: INCBIN "gfx/battle_hud2.1bpp"
-BattleHudTiles3: INCBIN "gfx/battle_hud3.1bpp"
-BattleHudTiles3End:
-NintendoCopyrightLogoGraphics: INCBIN "gfx/copyright.2bpp"
-GamefreakLogoGraphics: INCBIN "gfx/gamefreak.2bpp"
-GamefreakLogoGraphicsEnd:
-TextBoxGraphics: INCBIN "gfx/text_box.2bpp"
-TextBoxGraphicsEnd:
-PokedexTileGraphics: INCBIN "gfx/pokedex.2bpp"
-PokedexTileGraphicsEnd:
-WorldMapTileGraphics: INCBIN "gfx/town_map.2bpp"
-WorldMapTileGraphicsEnd:
-PlayerCharacterTitleGraphics: INCBIN "gfx/player_title.2bpp"
-PlayerCharacterTitleGraphicsEnd:
-
-
-SECTION "Battle (BANK 4)", ROMX
-
-INCLUDE "engine/overworld/is_player_just_outside_map.asm"
-INCLUDE "engine/menu/status_screen.asm"
-INCLUDE "engine/menu/party_menu.asm"
-
-RedPicFront:: INCBIN "pic/trainer/red.pic"
-ShrinkPic1:: INCBIN "pic/trainer/shrink1.pic"
-ShrinkPic2:: INCBIN "pic/trainer/shrink2.pic"
-
-INCLUDE "engine/turn_sprite.asm"
-INCLUDE "engine/menu/start_sub_menus.asm"
-INCLUDE "engine/items/tms.asm"
INCLUDE "engine/battle/end_of_battle.asm"
INCLUDE "engine/battle/wild_encounters.asm"
INCLUDE "engine/battle/moveEffects/recoil_effect.asm"
INCLUDE "engine/battle/moveEffects/conversion_effect.asm"
INCLUDE "engine/battle/moveEffects/haze_effect.asm"
-INCLUDE "engine/battle/get_trainer_name.asm"
-INCLUDE "engine/random.asm"
SECTION "NPC Sprites 2", ROMX ; BANK $05
+INCLUDE "engine/load_pokedex_tiles.asm"
+INCLUDE "engine/overworld/map_sprites.asm"
+
RedCyclingSprite: INCBIN "gfx/sprites/cycling.2bpp"
RedSprite: INCBIN "gfx/sprites/red.2bpp"
BlueSprite: INCBIN "gfx/sprites/blue.2bpp"
@@ -251,13 +221,6 @@ BrunoSprite: INCBIN "gfx/sprites/bruno.2bpp"
LoreleiSprite: INCBIN "gfx/sprites/lorelei.2bpp"
SeelSprite: INCBIN "gfx/sprites/seel.2bpp"
-
-SECTION "Battle (BANK 5)", ROMX
-
-INCLUDE "engine/load_pokedex_tiles.asm"
-INCLUDE "engine/overworld/map_sprites.asm"
-INCLUDE "engine/overworld/emotion_bubbles.asm"
-INCLUDE "engine/evolve_trade.asm"
INCLUDE "engine/battle/moveEffects/substitute_effect.asm"
INCLUDE "engine/menu/pc.asm"
@@ -293,8 +256,6 @@ INCLUDE "data/mapHeaders/FuchsiaCity.asm"
INCLUDE "data/mapObjects/FuchsiaCity.asm"
FuchsiaCity_Blocks: INCBIN "maps/FuchsiaCity.blk"
-INCLUDE "engine/play_time.asm"
-
INCLUDE "scripts/PalletTown.asm"
INCLUDE "scripts/ViridianCity.asm"
INCLUDE "scripts/PewterCity.asm"
@@ -373,8 +334,6 @@ CeruleanTrashedHouse_Blocks: INCBIN "maps/CeruleanTrashedHouse.blk"
DiglettsCaveRoute11_Blocks:
DiglettsCaveRoute2_Blocks: INCBIN "maps/DiglettsCaveRoute2.blk"
-INCLUDE "text/monster_names.asm"
-
INCLUDE "engine/clear_save.asm"
INCLUDE "engine/predefs7.asm"
@@ -522,372 +481,350 @@ INCLUDE "engine/hidden_object_functions7.asm"
SECTION "Pics 1", ROMX ; BANK $09
-RhydonPicFront:: INCBIN "pic/bmon/rhydon.pic"
+RhydonPicFront:: INCBIN "pic/ymon/rhydon.pic"
RhydonPicBack:: INCBIN "pic/monback/rhydonb.pic"
-KangaskhanPicFront:: INCBIN "pic/bmon/kangaskhan.pic"
+KangaskhanPicFront:: INCBIN "pic/ymon/kangaskhan.pic"
KangaskhanPicBack:: INCBIN "pic/monback/kangaskhanb.pic"
-NidoranMPicFront:: INCBIN "pic/bmon/nidoranm.pic"
+NidoranMPicFront:: INCBIN "pic/ymon/nidoranm.pic"
NidoranMPicBack:: INCBIN "pic/monback/nidoranmb.pic"
-ClefairyPicFront:: INCBIN "pic/bmon/clefairy.pic"
+ClefairyPicFront:: INCBIN "pic/ymon/clefairy.pic"
ClefairyPicBack:: INCBIN "pic/monback/clefairyb.pic"
-SpearowPicFront:: INCBIN "pic/bmon/spearow.pic"
+SpearowPicFront:: INCBIN "pic/ymon/spearow.pic"
SpearowPicBack:: INCBIN "pic/monback/spearowb.pic"
-VoltorbPicFront:: INCBIN "pic/bmon/voltorb.pic"
+VoltorbPicFront:: INCBIN "pic/ymon/voltorb.pic"
VoltorbPicBack:: INCBIN "pic/monback/voltorbb.pic"
-NidokingPicFront:: INCBIN "pic/bmon/nidoking.pic"
+NidokingPicFront:: INCBIN "pic/ymon/nidoking.pic"
NidokingPicBack:: INCBIN "pic/monback/nidokingb.pic"
-SlowbroPicFront:: INCBIN "pic/bmon/slowbro.pic"
+SlowbroPicFront:: INCBIN "pic/ymon/slowbro.pic"
SlowbroPicBack:: INCBIN "pic/monback/slowbrob.pic"
-IvysaurPicFront:: INCBIN "pic/bmon/ivysaur.pic"
+IvysaurPicFront:: INCBIN "pic/ymon/ivysaur.pic"
IvysaurPicBack:: INCBIN "pic/monback/ivysaurb.pic"
-ExeggutorPicFront:: INCBIN "pic/bmon/exeggutor.pic"
+ExeggutorPicFront:: INCBIN "pic/ymon/exeggutor.pic"
ExeggutorPicBack:: INCBIN "pic/monback/exeggutorb.pic"
-LickitungPicFront:: INCBIN "pic/bmon/lickitung.pic"
+LickitungPicFront:: INCBIN "pic/ymon/lickitung.pic"
LickitungPicBack:: INCBIN "pic/monback/lickitungb.pic"
-ExeggcutePicFront:: INCBIN "pic/bmon/exeggcute.pic"
+ExeggcutePicFront:: INCBIN "pic/ymon/exeggcute.pic"
ExeggcutePicBack:: INCBIN "pic/monback/exeggcuteb.pic"
-GrimerPicFront:: INCBIN "pic/bmon/grimer.pic"
+GrimerPicFront:: INCBIN "pic/ymon/grimer.pic"
GrimerPicBack:: INCBIN "pic/monback/grimerb.pic"
-GengarPicFront:: INCBIN "pic/bmon/gengar.pic"
+GengarPicFront:: INCBIN "pic/ymon/gengar.pic"
GengarPicBack:: INCBIN "pic/monback/gengarb.pic"
-NidoranFPicFront:: INCBIN "pic/bmon/nidoranf.pic"
+NidoranFPicFront:: INCBIN "pic/ymon/nidoranf.pic"
NidoranFPicBack:: INCBIN "pic/monback/nidoranfb.pic"
-NidoqueenPicFront:: INCBIN "pic/bmon/nidoqueen.pic"
+NidoqueenPicFront:: INCBIN "pic/ymon/nidoqueen.pic"
NidoqueenPicBack:: INCBIN "pic/monback/nidoqueenb.pic"
-CubonePicFront:: INCBIN "pic/bmon/cubone.pic"
+CubonePicFront:: INCBIN "pic/ymon/cubone.pic"
CubonePicBack:: INCBIN "pic/monback/cuboneb.pic"
-RhyhornPicFront:: INCBIN "pic/bmon/rhyhorn.pic"
+RhyhornPicFront:: INCBIN "pic/ymon/rhyhorn.pic"
RhyhornPicBack:: INCBIN "pic/monback/rhyhornb.pic"
-LaprasPicFront:: INCBIN "pic/bmon/lapras.pic"
+LaprasPicFront:: INCBIN "pic/ymon/lapras.pic"
LaprasPicBack:: INCBIN "pic/monback/laprasb.pic"
-ArcaninePicFront:: INCBIN "pic/bmon/arcanine.pic"
+ArcaninePicFront:: INCBIN "pic/ymon/arcanine.pic"
ArcaninePicBack:: INCBIN "pic/monback/arcanineb.pic"
-GyaradosPicFront:: INCBIN "pic/bmon/gyarados.pic"
+MewPicFront:: INCBIN "pic/ymon/mew.pic"
+MewPicBack:: INCBIN "pic/monback/mewb.pic"
+GyaradosPicFront:: INCBIN "pic/ymon/gyarados.pic"
GyaradosPicBack:: INCBIN "pic/monback/gyaradosb.pic"
-ShellderPicFront:: INCBIN "pic/bmon/shellder.pic"
+ShellderPicFront:: INCBIN "pic/ymon/shellder.pic"
ShellderPicBack:: INCBIN "pic/monback/shellderb.pic"
-TentacoolPicFront:: INCBIN "pic/bmon/tentacool.pic"
+TentacoolPicFront:: INCBIN "pic/ymon/tentacool.pic"
TentacoolPicBack:: INCBIN "pic/monback/tentacoolb.pic"
-GastlyPicFront:: INCBIN "pic/bmon/gastly.pic"
+GastlyPicFront:: INCBIN "pic/ymon/gastly.pic"
GastlyPicBack:: INCBIN "pic/monback/gastlyb.pic"
-ScytherPicFront:: INCBIN "pic/bmon/scyther.pic"
+ScytherPicFront:: INCBIN "pic/ymon/scyther.pic"
ScytherPicBack:: INCBIN "pic/monback/scytherb.pic"
-StaryuPicFront:: INCBIN "pic/bmon/staryu.pic"
+StaryuPicFront:: INCBIN "pic/ymon/staryu.pic"
StaryuPicBack:: INCBIN "pic/monback/staryub.pic"
-BlastoisePicFront:: INCBIN "pic/bmon/blastoise.pic"
+BlastoisePicFront:: INCBIN "pic/ymon/blastoise.pic"
BlastoisePicBack:: INCBIN "pic/monback/blastoiseb.pic"
-PinsirPicFront:: INCBIN "pic/bmon/pinsir.pic"
+PinsirPicFront:: INCBIN "pic/ymon/pinsir.pic"
PinsirPicBack:: INCBIN "pic/monback/pinsirb.pic"
-TangelaPicFront:: INCBIN "pic/bmon/tangela.pic"
+TangelaPicFront:: INCBIN "pic/ymon/tangela.pic"
TangelaPicBack:: INCBIN "pic/monback/tangelab.pic"
-
-SECTION "Battle (BANK 9)", ROMX
-
INCLUDE "engine/battle/print_type.asm"
INCLUDE "engine/battle/save_trainer_name.asm"
-INCLUDE "engine/battle/moveEffects/focus_energy_effect.asm"
SECTION "Pics 2", ROMX ; BANK $0A
-GrowlithePicFront:: INCBIN "pic/bmon/growlithe.pic"
+GrowlithePicFront:: INCBIN "pic/ymon/growlithe.pic"
GrowlithePicBack:: INCBIN "pic/monback/growlitheb.pic"
-OnixPicFront:: INCBIN "pic/bmon/onix.pic"
+OnixPicFront:: INCBIN "pic/ymon/onix.pic"
OnixPicBack:: INCBIN "pic/monback/onixb.pic"
-FearowPicFront:: INCBIN "pic/bmon/fearow.pic"
+FearowPicFront:: INCBIN "pic/ymon/fearow.pic"
FearowPicBack:: INCBIN "pic/monback/fearowb.pic"
-PidgeyPicFront:: INCBIN "pic/bmon/pidgey.pic"
+PidgeyPicFront:: INCBIN "pic/ymon/pidgey.pic"
PidgeyPicBack:: INCBIN "pic/monback/pidgeyb.pic"
-SlowpokePicFront:: INCBIN "pic/bmon/slowpoke.pic"
+SlowpokePicFront:: INCBIN "pic/ymon/slowpoke.pic"
SlowpokePicBack:: INCBIN "pic/monback/slowpokeb.pic"
-KadabraPicFront:: INCBIN "pic/bmon/kadabra.pic"
+KadabraPicFront:: INCBIN "pic/ymon/kadabra.pic"
KadabraPicBack:: INCBIN "pic/monback/kadabrab.pic"
-GravelerPicFront:: INCBIN "pic/bmon/graveler.pic"
+GravelerPicFront:: INCBIN "pic/ymon/graveler.pic"
GravelerPicBack:: INCBIN "pic/monback/gravelerb.pic"
-ChanseyPicFront:: INCBIN "pic/bmon/chansey.pic"
+ChanseyPicFront:: INCBIN "pic/ymon/chansey.pic"
ChanseyPicBack:: INCBIN "pic/monback/chanseyb.pic"
-MachokePicFront:: INCBIN "pic/bmon/machoke.pic"
+MachokePicFront:: INCBIN "pic/ymon/machoke.pic"
MachokePicBack:: INCBIN "pic/monback/machokeb.pic"
-MrMimePicFront:: INCBIN "pic/bmon/mr.mime.pic"
+MrMimePicFront:: INCBIN "pic/ymon/mr.mime.pic"
MrMimePicBack:: INCBIN "pic/monback/mr.mimeb.pic"
-HitmonleePicFront:: INCBIN "pic/bmon/hitmonlee.pic"
+HitmonleePicFront:: INCBIN "pic/ymon/hitmonlee.pic"
HitmonleePicBack:: INCBIN "pic/monback/hitmonleeb.pic"
-HitmonchanPicFront:: INCBIN "pic/bmon/hitmonchan.pic"
+HitmonchanPicFront:: INCBIN "pic/ymon/hitmonchan.pic"
HitmonchanPicBack:: INCBIN "pic/monback/hitmonchanb.pic"
-ArbokPicFront:: INCBIN "pic/bmon/arbok.pic"
+ArbokPicFront:: INCBIN "pic/ymon/arbok.pic"
ArbokPicBack:: INCBIN "pic/monback/arbokb.pic"
-ParasectPicFront:: INCBIN "pic/bmon/parasect.pic"
+ParasectPicFront:: INCBIN "pic/ymon/parasect.pic"
ParasectPicBack:: INCBIN "pic/monback/parasectb.pic"
-PsyduckPicFront:: INCBIN "pic/bmon/psyduck.pic"
+PsyduckPicFront:: INCBIN "pic/ymon/psyduck.pic"
PsyduckPicBack:: INCBIN "pic/monback/psyduckb.pic"
-DrowzeePicFront:: INCBIN "pic/bmon/drowzee.pic"
+DrowzeePicFront:: INCBIN "pic/ymon/drowzee.pic"
DrowzeePicBack:: INCBIN "pic/monback/drowzeeb.pic"
-GolemPicFront:: INCBIN "pic/bmon/golem.pic"
+GolemPicFront:: INCBIN "pic/ymon/golem.pic"
GolemPicBack:: INCBIN "pic/monback/golemb.pic"
-MagmarPicFront:: INCBIN "pic/bmon/magmar.pic"
+MagmarPicFront:: INCBIN "pic/ymon/magmar.pic"
MagmarPicBack:: INCBIN "pic/monback/magmarb.pic"
-ElectabuzzPicFront:: INCBIN "pic/bmon/electabuzz.pic"
+ElectabuzzPicFront:: INCBIN "pic/ymon/electabuzz.pic"
ElectabuzzPicBack:: INCBIN "pic/monback/electabuzzb.pic"
-MagnetonPicFront:: INCBIN "pic/bmon/magneton.pic"
+MagnetonPicFront:: INCBIN "pic/ymon/magneton.pic"
MagnetonPicBack:: INCBIN "pic/monback/magnetonb.pic"
-KoffingPicFront:: INCBIN "pic/bmon/koffing.pic"
+KoffingPicFront:: INCBIN "pic/ymon/koffing.pic"
KoffingPicBack:: INCBIN "pic/monback/koffingb.pic"
-MankeyPicFront:: INCBIN "pic/bmon/mankey.pic"
+MankeyPicFront:: INCBIN "pic/ymon/mankey.pic"
MankeyPicBack:: INCBIN "pic/monback/mankeyb.pic"
-SeelPicFront:: INCBIN "pic/bmon/seel.pic"
+SeelPicFront:: INCBIN "pic/ymon/seel.pic"
SeelPicBack:: INCBIN "pic/monback/seelb.pic"
-DiglettPicFront:: INCBIN "pic/bmon/diglett.pic"
+DiglettPicFront:: INCBIN "pic/ymon/diglett.pic"
DiglettPicBack:: INCBIN "pic/monback/diglettb.pic"
-TaurosPicFront:: INCBIN "pic/bmon/tauros.pic"
+TaurosPicFront:: INCBIN "pic/ymon/tauros.pic"
TaurosPicBack:: INCBIN "pic/monback/taurosb.pic"
-FarfetchdPicFront:: INCBIN "pic/bmon/farfetchd.pic"
+FarfetchdPicFront:: INCBIN "pic/ymon/farfetchd.pic"
FarfetchdPicBack:: INCBIN "pic/monback/farfetchdb.pic"
-VenonatPicFront:: INCBIN "pic/bmon/venonat.pic"
+VenonatPicFront:: INCBIN "pic/ymon/venonat.pic"
VenonatPicBack:: INCBIN "pic/monback/venonatb.pic"
-DragonitePicFront:: INCBIN "pic/bmon/dragonite.pic"
+DragonitePicFront:: INCBIN "pic/ymon/dragonite.pic"
DragonitePicBack:: INCBIN "pic/monback/dragoniteb.pic"
-DoduoPicFront:: INCBIN "pic/bmon/doduo.pic"
+DoduoPicFront:: INCBIN "pic/ymon/doduo.pic"
DoduoPicBack:: INCBIN "pic/monback/doduob.pic"
-PoliwagPicFront:: INCBIN "pic/bmon/poliwag.pic"
+PoliwagPicFront:: INCBIN "pic/ymon/poliwag.pic"
PoliwagPicBack:: INCBIN "pic/monback/poliwagb.pic"
-JynxPicFront:: INCBIN "pic/bmon/jynx.pic"
+JynxPicFront:: INCBIN "pic/ymon/jynx.pic"
JynxPicBack:: INCBIN "pic/monback/jynxb.pic"
-MoltresPicFront:: INCBIN "pic/bmon/moltres.pic"
+MoltresPicFront:: INCBIN "pic/ymon/moltres.pic"
MoltresPicBack:: INCBIN "pic/monback/moltresb.pic"
-
-SECTION "Battle (BANK A)", ROMX
-
+INCLUDE "engine/predefsA.asm"
INCLUDE "engine/battle/moveEffects/leech_seed_effect.asm"
SECTION "Pics 3", ROMX ; BANK $0B
-ArticunoPicFront:: INCBIN "pic/bmon/articuno.pic"
+ArticunoPicFront:: INCBIN "pic/ymon/articuno.pic"
ArticunoPicBack:: INCBIN "pic/monback/articunob.pic"
-ZapdosPicFront:: INCBIN "pic/bmon/zapdos.pic"
+ZapdosPicFront:: INCBIN "pic/ymon/zapdos.pic"
ZapdosPicBack:: INCBIN "pic/monback/zapdosb.pic"
-DittoPicFront:: INCBIN "pic/bmon/ditto.pic"
+DittoPicFront:: INCBIN "pic/ymon/ditto.pic"
DittoPicBack:: INCBIN "pic/monback/dittob.pic"
-MeowthPicFront:: INCBIN "pic/bmon/meowth.pic"
+MeowthPicFront:: INCBIN "pic/ymon/meowth.pic"
MeowthPicBack:: INCBIN "pic/monback/meowthb.pic"
-KrabbyPicFront:: INCBIN "pic/bmon/krabby.pic"
+KrabbyPicFront:: INCBIN "pic/ymon/krabby.pic"
KrabbyPicBack:: INCBIN "pic/monback/krabbyb.pic"
-VulpixPicFront:: INCBIN "pic/bmon/vulpix.pic"
+VulpixPicFront:: INCBIN "pic/ymon/vulpix.pic"
VulpixPicBack:: INCBIN "pic/monback/vulpixb.pic"
-NinetalesPicFront:: INCBIN "pic/bmon/ninetales.pic"
+NinetalesPicFront:: INCBIN "pic/ymon/ninetales.pic"
NinetalesPicBack:: INCBIN "pic/monback/ninetalesb.pic"
-PikachuPicFront:: INCBIN "pic/bmon/pikachu.pic"
+PikachuPicFront:: INCBIN "pic/ymon/pikachu.pic"
PikachuPicBack:: INCBIN "pic/monback/pikachub.pic"
-RaichuPicFront:: INCBIN "pic/bmon/raichu.pic"
+RaichuPicFront:: INCBIN "pic/ymon/raichu.pic"
RaichuPicBack:: INCBIN "pic/monback/raichub.pic"
-DratiniPicFront:: INCBIN "pic/bmon/dratini.pic"
+DratiniPicFront:: INCBIN "pic/ymon/dratini.pic"
DratiniPicBack:: INCBIN "pic/monback/dratinib.pic"
-DragonairPicFront:: INCBIN "pic/bmon/dragonair.pic"
+DragonairPicFront:: INCBIN "pic/ymon/dragonair.pic"
DragonairPicBack:: INCBIN "pic/monback/dragonairb.pic"
-KabutoPicFront:: INCBIN "pic/bmon/kabuto.pic"
+KabutoPicFront:: INCBIN "pic/ymon/kabuto.pic"
KabutoPicBack:: INCBIN "pic/monback/kabutob.pic"
-KabutopsPicFront:: INCBIN "pic/bmon/kabutops.pic"
+KabutopsPicFront:: INCBIN "pic/ymon/kabutops.pic"
KabutopsPicBack:: INCBIN "pic/monback/kabutopsb.pic"
-HorseaPicFront:: INCBIN "pic/bmon/horsea.pic"
+HorseaPicFront:: INCBIN "pic/ymon/horsea.pic"
HorseaPicBack:: INCBIN "pic/monback/horseab.pic"
-SeadraPicFront:: INCBIN "pic/bmon/seadra.pic"
+SeadraPicFront:: INCBIN "pic/ymon/seadra.pic"
SeadraPicBack:: INCBIN "pic/monback/seadrab.pic"
-SandshrewPicFront:: INCBIN "pic/bmon/sandshrew.pic"
+SandshrewPicFront:: INCBIN "pic/ymon/sandshrew.pic"
SandshrewPicBack:: INCBIN "pic/monback/sandshrewb.pic"
-SandslashPicFront:: INCBIN "pic/bmon/sandslash.pic"
+SandslashPicFront:: INCBIN "pic/ymon/sandslash.pic"
SandslashPicBack:: INCBIN "pic/monback/sandslashb.pic"
-OmanytePicFront:: INCBIN "pic/bmon/omanyte.pic"
+OmanytePicFront:: INCBIN "pic/ymon/omanyte.pic"
OmanytePicBack:: INCBIN "pic/monback/omanyteb.pic"
-OmastarPicFront:: INCBIN "pic/bmon/omastar.pic"
+OmastarPicFront:: INCBIN "pic/ymon/omastar.pic"
OmastarPicBack:: INCBIN "pic/monback/omastarb.pic"
-JigglypuffPicFront:: INCBIN "pic/bmon/jigglypuff.pic"
+JigglypuffPicFront:: INCBIN "pic/ymon/jigglypuff.pic"
JigglypuffPicBack:: INCBIN "pic/monback/jigglypuffb.pic"
-WigglytuffPicFront:: INCBIN "pic/bmon/wigglytuff.pic"
+WigglytuffPicFront:: INCBIN "pic/ymon/wigglytuff.pic"
WigglytuffPicBack:: INCBIN "pic/monback/wigglytuffb.pic"
-EeveePicFront:: INCBIN "pic/bmon/eevee.pic"
+EeveePicFront:: INCBIN "pic/ymon/eevee.pic"
EeveePicBack:: INCBIN "pic/monback/eeveeb.pic"
-FlareonPicFront:: INCBIN "pic/bmon/flareon.pic"
+FlareonPicFront:: INCBIN "pic/ymon/flareon.pic"
FlareonPicBack:: INCBIN "pic/monback/flareonb.pic"
-JolteonPicFront:: INCBIN "pic/bmon/jolteon.pic"
+JolteonPicFront:: INCBIN "pic/ymon/jolteon.pic"
JolteonPicBack:: INCBIN "pic/monback/jolteonb.pic"
-VaporeonPicFront:: INCBIN "pic/bmon/vaporeon.pic"
+VaporeonPicFront:: INCBIN "pic/ymon/vaporeon.pic"
VaporeonPicBack:: INCBIN "pic/monback/vaporeonb.pic"
-MachopPicFront:: INCBIN "pic/bmon/machop.pic"
+MachopPicFront:: INCBIN "pic/ymon/machop.pic"
MachopPicBack:: INCBIN "pic/monback/machopb.pic"
-ZubatPicFront:: INCBIN "pic/bmon/zubat.pic"
+ZubatPicFront:: INCBIN "pic/ymon/zubat.pic"
ZubatPicBack:: INCBIN "pic/monback/zubatb.pic"
-EkansPicFront:: INCBIN "pic/bmon/ekans.pic"
+EkansPicFront:: INCBIN "pic/ymon/ekans.pic"
EkansPicBack:: INCBIN "pic/monback/ekansb.pic"
-ParasPicFront:: INCBIN "pic/bmon/paras.pic"
+ParasPicFront:: INCBIN "pic/ymon/paras.pic"
ParasPicBack:: INCBIN "pic/monback/parasb.pic"
-PoliwhirlPicFront:: INCBIN "pic/bmon/poliwhirl.pic"
+PoliwhirlPicFront:: INCBIN "pic/ymon/poliwhirl.pic"
PoliwhirlPicBack:: INCBIN "pic/monback/poliwhirlb.pic"
-PoliwrathPicFront:: INCBIN "pic/bmon/poliwrath.pic"
+PoliwrathPicFront:: INCBIN "pic/ymon/poliwrath.pic"
PoliwrathPicBack:: INCBIN "pic/monback/poliwrathb.pic"
-WeedlePicFront:: INCBIN "pic/bmon/weedle.pic"
+WeedlePicFront:: INCBIN "pic/ymon/weedle.pic"
WeedlePicBack:: INCBIN "pic/monback/weedleb.pic"
-KakunaPicFront:: INCBIN "pic/bmon/kakuna.pic"
+KakunaPicFront:: INCBIN "pic/ymon/kakuna.pic"
KakunaPicBack:: INCBIN "pic/monback/kakunab.pic"
-BeedrillPicFront:: INCBIN "pic/bmon/beedrill.pic"
+BeedrillPicFront:: INCBIN "pic/ymon/beedrill.pic"
BeedrillPicBack:: INCBIN "pic/monback/beedrillb.pic"
-FossilKabutopsPic:: INCBIN "pic/bmon/fossilkabutops.pic"
-
-
-SECTION "Battle (BANK B)", ROMX
+FossilKabutopsPic:: INCBIN "pic/ymon/fossilkabutops.pic"
INCLUDE "engine/battle/display_effectiveness.asm"
+INCLUDE "engine/items/tmhm.asm"
-TrainerInfoTextBoxTileGraphics: INCBIN "gfx/trainer_info.2bpp"
-TrainerInfoTextBoxTileGraphicsEnd:
-BlankLeaderNames: INCBIN "gfx/blank_leader_names.2bpp"
-CircleTile: INCBIN "gfx/circle_tile.2bpp"
-BadgeNumbersTileGraphics: INCBIN "gfx/badge_numbers.2bpp"
+Func_2fd6a:
+ callab IsThisPartymonStarterPikachu_Party
+ ret nc
+ ld a, $3
+ ld [wPikachuSpawnState], a
+ ret
-INCLUDE "engine/items/tmhm.asm"
INCLUDE "engine/battle/scale_sprites.asm"
-INCLUDE "engine/battle/moveEffects/pay_day_effect.asm"
INCLUDE "engine/game_corner_slots2.asm"
SECTION "Pics 4", ROMX ; BANK $0C
-DodrioPicFront:: INCBIN "pic/bmon/dodrio.pic"
+DodrioPicFront:: INCBIN "pic/ymon/dodrio.pic"
DodrioPicBack:: INCBIN "pic/monback/dodriob.pic"
-PrimeapePicFront:: INCBIN "pic/bmon/primeape.pic"
+PrimeapePicFront:: INCBIN "pic/ymon/primeape.pic"
PrimeapePicBack:: INCBIN "pic/monback/primeapeb.pic"
-DugtrioPicFront:: INCBIN "pic/bmon/dugtrio.pic"
+DugtrioPicFront:: INCBIN "pic/ymon/dugtrio.pic"
DugtrioPicBack:: INCBIN "pic/monback/dugtriob.pic"
-VenomothPicFront:: INCBIN "pic/bmon/venomoth.pic"
+VenomothPicFront:: INCBIN "pic/ymon/venomoth.pic"
VenomothPicBack:: INCBIN "pic/monback/venomothb.pic"
-DewgongPicFront:: INCBIN "pic/bmon/dewgong.pic"
+DewgongPicFront:: INCBIN "pic/ymon/dewgong.pic"
DewgongPicBack:: INCBIN "pic/monback/dewgongb.pic"
-CaterpiePicFront:: INCBIN "pic/bmon/caterpie.pic"
+CaterpiePicFront:: INCBIN "pic/ymon/caterpie.pic"
CaterpiePicBack:: INCBIN "pic/monback/caterpieb.pic"
-MetapodPicFront:: INCBIN "pic/bmon/metapod.pic"
+MetapodPicFront:: INCBIN "pic/ymon/metapod.pic"
MetapodPicBack:: INCBIN "pic/monback/metapodb.pic"
-ButterfreePicFront:: INCBIN "pic/bmon/butterfree.pic"
+ButterfreePicFront:: INCBIN "pic/ymon/butterfree.pic"
ButterfreePicBack:: INCBIN "pic/monback/butterfreeb.pic"
-MachampPicFront:: INCBIN "pic/bmon/machamp.pic"
+MachampPicFront:: INCBIN "pic/ymon/machamp.pic"
MachampPicBack:: INCBIN "pic/monback/machampb.pic"
-GolduckPicFront:: INCBIN "pic/bmon/golduck.pic"
+GolduckPicFront:: INCBIN "pic/ymon/golduck.pic"
GolduckPicBack:: INCBIN "pic/monback/golduckb.pic"
-HypnoPicFront:: INCBIN "pic/bmon/hypno.pic"
+HypnoPicFront:: INCBIN "pic/ymon/hypno.pic"
HypnoPicBack:: INCBIN "pic/monback/hypnob.pic"
-GolbatPicFront:: INCBIN "pic/bmon/golbat.pic"
+GolbatPicFront:: INCBIN "pic/ymon/golbat.pic"
GolbatPicBack:: INCBIN "pic/monback/golbatb.pic"
-MewtwoPicFront:: INCBIN "pic/bmon/mewtwo.pic"
+MewtwoPicFront:: INCBIN "pic/ymon/mewtwo.pic"
MewtwoPicBack:: INCBIN "pic/monback/mewtwob.pic"
-SnorlaxPicFront:: INCBIN "pic/bmon/snorlax.pic"
+SnorlaxPicFront:: INCBIN "pic/ymon/snorlax.pic"
SnorlaxPicBack:: INCBIN "pic/monback/snorlaxb.pic"
-MagikarpPicFront:: INCBIN "pic/bmon/magikarp.pic"
+MagikarpPicFront:: INCBIN "pic/ymon/magikarp.pic"
MagikarpPicBack:: INCBIN "pic/monback/magikarpb.pic"
-MukPicFront:: INCBIN "pic/bmon/muk.pic"
+MukPicFront:: INCBIN "pic/ymon/muk.pic"
MukPicBack:: INCBIN "pic/monback/mukb.pic"
-KinglerPicFront:: INCBIN "pic/bmon/kingler.pic"
+KinglerPicFront:: INCBIN "pic/ymon/kingler.pic"
KinglerPicBack:: INCBIN "pic/monback/kinglerb.pic"
-CloysterPicFront:: INCBIN "pic/bmon/cloyster.pic"
+CloysterPicFront:: INCBIN "pic/ymon/cloyster.pic"
CloysterPicBack:: INCBIN "pic/monback/cloysterb.pic"
-ElectrodePicFront:: INCBIN "pic/bmon/electrode.pic"
+ElectrodePicFront:: INCBIN "pic/ymon/electrode.pic"
ElectrodePicBack:: INCBIN "pic/monback/electrodeb.pic"
-ClefablePicFront:: INCBIN "pic/bmon/clefable.pic"
+ClefablePicFront:: INCBIN "pic/ymon/clefable.pic"
ClefablePicBack:: INCBIN "pic/monback/clefableb.pic"
-WeezingPicFront:: INCBIN "pic/bmon/weezing.pic"
+WeezingPicFront:: INCBIN "pic/ymon/weezing.pic"
WeezingPicBack:: INCBIN "pic/monback/weezingb.pic"
-PersianPicFront:: INCBIN "pic/bmon/persian.pic"
+PersianPicFront:: INCBIN "pic/ymon/persian.pic"
PersianPicBack:: INCBIN "pic/monback/persianb.pic"
-MarowakPicFront:: INCBIN "pic/bmon/marowak.pic"
+MarowakPicFront:: INCBIN "pic/ymon/marowak.pic"
MarowakPicBack:: INCBIN "pic/monback/marowakb.pic"
-HaunterPicFront:: INCBIN "pic/bmon/haunter.pic"
+HaunterPicFront:: INCBIN "pic/ymon/haunter.pic"
HaunterPicBack:: INCBIN "pic/monback/haunterb.pic"
-AbraPicFront:: INCBIN "pic/bmon/abra.pic"
+AbraPicFront:: INCBIN "pic/ymon/abra.pic"
AbraPicBack:: INCBIN "pic/monback/abrab.pic"
-AlakazamPicFront:: INCBIN "pic/bmon/alakazam.pic"
+AlakazamPicFront:: INCBIN "pic/ymon/alakazam.pic"
AlakazamPicBack:: INCBIN "pic/monback/alakazamb.pic"
-PidgeottoPicFront:: INCBIN "pic/bmon/pidgeotto.pic"
+PidgeottoPicFront:: INCBIN "pic/ymon/pidgeotto.pic"
PidgeottoPicBack:: INCBIN "pic/monback/pidgeottob.pic"
-PidgeotPicFront:: INCBIN "pic/bmon/pidgeot.pic"
+PidgeotPicFront:: INCBIN "pic/ymon/pidgeot.pic"
PidgeotPicBack:: INCBIN "pic/monback/pidgeotb.pic"
-StarmiePicFront:: INCBIN "pic/bmon/starmie.pic"
+StarmiePicFront:: INCBIN "pic/ymon/starmie.pic"
StarmiePicBack:: INCBIN "pic/monback/starmieb.pic"
-RedPicBack:: INCBIN "pic/trainer/redb.pic"
-OldManPic:: INCBIN "pic/trainer/oldman.pic"
-
-
-SECTION "Battle (BANK C)", ROMX
-
-INCLUDE "engine/battle/moveEffects/mist_effect.asm"
-INCLUDE "engine/battle/moveEffects/one_hit_ko_effect.asm"
-
SECTION "Pics 5", ROMX ; BANK $0D
-BulbasaurPicFront:: INCBIN "pic/bmon/bulbasaur.pic"
+BulbasaurPicFront:: INCBIN "pic/ymon/bulbasaur.pic"
BulbasaurPicBack:: INCBIN "pic/monback/bulbasaurb.pic"
-VenusaurPicFront:: INCBIN "pic/bmon/venusaur.pic"
+VenusaurPicFront:: INCBIN "pic/ymon/venusaur.pic"
VenusaurPicBack:: INCBIN "pic/monback/venusaurb.pic"
-TentacruelPicFront:: INCBIN "pic/bmon/tentacruel.pic"
+TentacruelPicFront:: INCBIN "pic/ymon/tentacruel.pic"
TentacruelPicBack:: INCBIN "pic/monback/tentacruelb.pic"
-GoldeenPicFront:: INCBIN "pic/bmon/goldeen.pic"
+GoldeenPicFront:: INCBIN "pic/ymon/goldeen.pic"
GoldeenPicBack:: INCBIN "pic/monback/goldeenb.pic"
-SeakingPicFront:: INCBIN "pic/bmon/seaking.pic"
+SeakingPicFront:: INCBIN "pic/ymon/seaking.pic"
SeakingPicBack:: INCBIN "pic/monback/seakingb.pic"
-PonytaPicFront:: INCBIN "pic/bmon/ponyta.pic"
-RapidashPicFront:: INCBIN "pic/bmon/rapidash.pic"
+PonytaPicFront:: INCBIN "pic/ymon/ponyta.pic"
+RapidashPicFront:: INCBIN "pic/ymon/rapidash.pic"
PonytaPicBack:: INCBIN "pic/monback/ponytab.pic"
RapidashPicBack:: INCBIN "pic/monback/rapidashb.pic"
-RattataPicFront:: INCBIN "pic/bmon/rattata.pic"
+RattataPicFront:: INCBIN "pic/ymon/rattata.pic"
RattataPicBack:: INCBIN "pic/monback/rattatab.pic"
-RaticatePicFront:: INCBIN "pic/bmon/raticate.pic"
+RaticatePicFront:: INCBIN "pic/ymon/raticate.pic"
RaticatePicBack:: INCBIN "pic/monback/raticateb.pic"
-NidorinoPicFront:: INCBIN "pic/bmon/nidorino.pic"
+NidorinoPicFront:: INCBIN "pic/ymon/nidorino.pic"
NidorinoPicBack:: INCBIN "pic/monback/nidorinob.pic"
-NidorinaPicFront:: INCBIN "pic/bmon/nidorina.pic"
+NidorinaPicFront:: INCBIN "pic/ymon/nidorina.pic"
NidorinaPicBack:: INCBIN "pic/monback/nidorinab.pic"
-GeodudePicFront:: INCBIN "pic/bmon/geodude.pic"
+GeodudePicFront:: INCBIN "pic/ymon/geodude.pic"
GeodudePicBack:: INCBIN "pic/monback/geodudeb.pic"
-PorygonPicFront:: INCBIN "pic/bmon/porygon.pic"
+PorygonPicFront:: INCBIN "pic/ymon/porygon.pic"
PorygonPicBack:: INCBIN "pic/monback/porygonb.pic"
-AerodactylPicFront:: INCBIN "pic/bmon/aerodactyl.pic"
+AerodactylPicFront:: INCBIN "pic/ymon/aerodactyl.pic"
AerodactylPicBack:: INCBIN "pic/monback/aerodactylb.pic"
-MagnemitePicFront:: INCBIN "pic/bmon/magnemite.pic"
+MagnemitePicFront:: INCBIN "pic/ymon/magnemite.pic"
MagnemitePicBack:: INCBIN "pic/monback/magnemiteb.pic"
-CharmanderPicFront:: INCBIN "pic/bmon/charmander.pic"
+CharmanderPicFront:: INCBIN "pic/ymon/charmander.pic"
CharmanderPicBack:: INCBIN "pic/monback/charmanderb.pic"
-SquirtlePicFront:: INCBIN "pic/bmon/squirtle.pic"
+SquirtlePicFront:: INCBIN "pic/ymon/squirtle.pic"
SquirtlePicBack:: INCBIN "pic/monback/squirtleb.pic"
-CharmeleonPicFront:: INCBIN "pic/bmon/charmeleon.pic"
+CharmeleonPicFront:: INCBIN "pic/ymon/charmeleon.pic"
CharmeleonPicBack:: INCBIN "pic/monback/charmeleonb.pic"
-WartortlePicFront:: INCBIN "pic/bmon/wartortle.pic"
+WartortlePicFront:: INCBIN "pic/ymon/wartortle.pic"
WartortlePicBack:: INCBIN "pic/monback/wartortleb.pic"
-CharizardPicFront:: INCBIN "pic/bmon/charizard.pic"
+CharizardPicFront:: INCBIN "pic/ymon/charizard.pic"
CharizardPicBack:: INCBIN "pic/monback/charizardb.pic"
-FossilAerodactylPic:: INCBIN "pic/bmon/fossilaerodactyl.pic"
+FossilAerodactylPic:: INCBIN "pic/ymon/fossilaerodactyl.pic"
GhostPic:: INCBIN "pic/other/ghost.pic"
-OddishPicFront:: INCBIN "pic/bmon/oddish.pic"
+OddishPicFront:: INCBIN "pic/ymon/oddish.pic"
OddishPicBack:: INCBIN "pic/monback/oddishb.pic"
-GloomPicFront:: INCBIN "pic/bmon/gloom.pic"
+GloomPicFront:: INCBIN "pic/ymon/gloom.pic"
GloomPicBack:: INCBIN "pic/monback/gloomb.pic"
-VileplumePicFront:: INCBIN "pic/bmon/vileplume.pic"
+VileplumePicFront:: INCBIN "pic/ymon/vileplume.pic"
VileplumePicBack:: INCBIN "pic/monback/vileplumeb.pic"
-BellsproutPicFront:: INCBIN "pic/bmon/bellsprout.pic"
+BellsproutPicFront:: INCBIN "pic/ymon/bellsprout.pic"
BellsproutPicBack:: INCBIN "pic/monback/bellsproutb.pic"
-WeepinbellPicFront:: INCBIN "pic/bmon/weepinbell.pic"
+WeepinbellPicFront:: INCBIN "pic/ymon/weepinbell.pic"
WeepinbellPicBack:: INCBIN "pic/monback/weepinbellb.pic"
-VictreebelPicFront:: INCBIN "pic/bmon/victreebel.pic"
+VictreebelPicFront:: INCBIN "pic/ymon/victreebel.pic"
VictreebelPicBack:: INCBIN "pic/monback/victreebelb.pic"
-
-SECTION "Battle (BANK D)", ROMX
-
INCLUDE "engine/titlescreen2.asm"
-INCLUDE "engine/battle/link_battle_versus_text.asm"
INCLUDE "engine/slot_machine.asm"
-INCLUDE "engine/overworld/pewter_guys.asm"
-INCLUDE "engine/multiply_divide.asm"
INCLUDE "engine/game_corner_slots.asm"
@@ -896,8 +833,6 @@ SECTION "bankE", ROMX
INCLUDE "data/moves.asm"
BaseStats: INCLUDE "data/base_stats.asm"
INCLUDE "data/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"
@@ -911,9 +846,6 @@ TradingAnimationGraphics2: INCBIN "gfx/trade2.2bpp"
TradingAnimationGraphics2End:
INCLUDE "engine/evos_moves.asm"
-INCLUDE "engine/battle/moveEffects/heal_effect.asm"
-INCLUDE "engine/battle/moveEffects/transform_effect.asm"
-INCLUDE "engine/battle/moveEffects/reflect_light_screen_effect.asm"
SECTION "bankF", ROMX
@@ -924,9 +856,11 @@ INCLUDE "engine/battle/core.asm"
SECTION "bank10", ROMX
INCLUDE "engine/menu/pokedex.asm"
+INCLUDE "engine/overworld/emotion_bubbles.asm"
INCLUDE "engine/trade.asm"
INCLUDE "engine/intro.asm"
INCLUDE "engine/trade2.asm"
+INCLUDE "engine/menu/options.asm"
SECTION "bank11", ROMX
@@ -950,6 +884,11 @@ INCLUDE "data/mapHeaders/ViridianPokecenter.asm"
INCLUDE "scripts/ViridianPokecenter.asm"
INCLUDE "data/mapObjects/ViridianPokecenter.asm"
+INCLUDE "data/mapHeaders/CeladonMart1F.asm"
+INCLUDE "scripts/CeladonMart1F.asm"
+INCLUDE "data/mapObjects/CeladonMart1F.asm"
+CeladonMart1F_Blocks: INCBIN "maps/CeladonMart1F.blk"
+
INCLUDE "data/mapHeaders/PokemonMansion1F.asm"
INCLUDE "scripts/PokemonMansion1F.asm"
INCLUDE "data/mapObjects/PokemonMansion1F.asm"
@@ -1071,7 +1010,7 @@ INCLUDE "scripts/SeafoamIslandsB4F.asm"
INCLUDE "data/mapObjects/SeafoamIslandsB4F.asm"
SeafoamIslandsB4F_Blocks: INCBIN "maps/SeafoamIslandsB4F.blk"
-INCLUDE "engine/overworld/hidden_objects.asm"
+INCLUDE "engine/overworld/dungeon_warps.asm"
SECTION "bank12", ROMX
@@ -1094,8 +1033,6 @@ Route15Gate2F_Blocks:
Route12Gate2F_Blocks:
Route11Gate2F_Blocks: INCBIN "maps/Route11Gate2F.blk"
-INCLUDE "engine/predefs12.asm"
-
INCLUDE "scripts/Route7.asm"
INCLUDE "data/mapHeaders/RedsHouse1F.asm"
@@ -1241,6 +1178,7 @@ INCLUDE "data/mapHeaders/MtMoonB2F.asm"
INCLUDE "scripts/MtMoonB2F.asm"
INCLUDE "data/mapObjects/MtMoonB2F.asm"
MtMoonB2F_Blocks: INCBIN "maps/MtMoonB2F.blk"
+INCLUDE "scripts/MtMoonB2F_2.asm"
INCLUDE "data/mapHeaders/SafariZoneWest.asm"
INCLUDE "scripts/SafariZoneWest.asm"
@@ -1279,7 +1217,7 @@ JugglerPic:: INCBIN "pic/trainer/juggler.pic"
TamerPic:: INCBIN "pic/trainer/tamer.pic"
BirdKeeperPic:: INCBIN "pic/trainer/birdkeeper.pic"
BlackbeltPic:: INCBIN "pic/trainer/blackbelt.pic"
-Rival1Pic:: INCBIN "pic/trainer/rival1.pic"
+Rival1Pic:: INCBIN "pic/ytrainer/rival1.pic"
ProfOakPic:: INCBIN "pic/trainer/prof.oak.pic"
ChiefPic::
ScientistPic:: INCBIN "pic/trainer/scientist.pic"
@@ -1288,20 +1226,21 @@ RocketPic:: INCBIN "pic/trainer/rocket.pic"
CooltrainerMPic:: INCBIN "pic/trainer/cooltrainerm.pic"
CooltrainerFPic:: INCBIN "pic/trainer/cooltrainerf.pic"
BrunoPic:: INCBIN "pic/trainer/bruno.pic"
-BrockPic:: INCBIN "pic/trainer/brock.pic"
-MistyPic:: INCBIN "pic/trainer/misty.pic"
+BrockPic:: INCBIN "pic/ytrainer/brock.pic"
+MistyPic:: INCBIN "pic/ytrainer/misty.pic"
LtSurgePic:: INCBIN "pic/trainer/lt.surge.pic"
-ErikaPic:: INCBIN "pic/trainer/erika.pic"
+ErikaPic:: INCBIN "pic/ytrainer/erika.pic"
KogaPic:: INCBIN "pic/trainer/koga.pic"
BlainePic:: INCBIN "pic/trainer/blaine.pic"
SabrinaPic:: INCBIN "pic/trainer/sabrina.pic"
GentlemanPic:: INCBIN "pic/trainer/gentleman.pic"
-Rival2Pic:: INCBIN "pic/trainer/rival2.pic"
-Rival3Pic:: INCBIN "pic/trainer/rival3.pic"
+Rival2Pic:: INCBIN "pic/ytrainer/rival2.pic"
+Rival3Pic:: INCBIN "pic/ytrainer/rival3.pic"
LoreleiPic:: INCBIN "pic/trainer/lorelei.pic"
ChannelerPic:: INCBIN "pic/trainer/channeler.pic"
AgathaPic:: INCBIN "pic/trainer/agatha.pic"
LancePic:: INCBIN "pic/trainer/lance.pic"
+JessieJamesPic:: INCBIN "pic/ytrainer/jessiejames.pic"
INCLUDE "data/mapHeaders/TradeCenter.asm"
INCLUDE "scripts/TradeCenter.asm"
@@ -1313,10 +1252,6 @@ INCLUDE "scripts/Colosseum.asm"
INCLUDE "data/mapObjects/Colosseum.asm"
Colosseum_Blocks: INCBIN "maps/Colosseum.blk"
-INCLUDE "engine/give_pokemon.asm"
-
-INCLUDE "engine/predefs.asm"
-
SECTION "bank14", ROMX
@@ -1386,9 +1321,6 @@ INCLUDE "scripts/PokemonMansionB1F.asm"
INCLUDE "data/mapObjects/PokemonMansionB1F.asm"
PokemonMansionB1F_Blocks: INCBIN "maps/PokemonMansionB1F.blk"
-INCLUDE "engine/battle/init_battle_variables.asm"
-INCLUDE "engine/battle/moveEffects/paralyze_effect.asm"
-
INCLUDE "engine/overworld/card_key.asm"
INCLUDE "engine/menu/prize_menu.asm"
@@ -1524,10 +1456,10 @@ Route18_Blocks: INCBIN "maps/Route18.blk"
INCBIN "maps/UnusedPokecenterCopy.blk"
-INCLUDE "engine/battle/common_text.asm"
-
INCLUDE "engine/experience.asm"
+INCLUDE "engine/status_ailments.asm"
+
INCLUDE "engine/overworld/oaks_aide.asm"
INCLUDE "scripts/Route6.asm"
@@ -1723,6 +1655,8 @@ INCLUDE "scripts/VictoryRoad1F.asm"
INCLUDE "data/mapObjects/VictoryRoad1F.asm"
VictoryRoad1F_Blocks: INCBIN "maps/VictoryRoad1F.blk"
+INCLUDE "engine/evolution.asm"
+
INCLUDE "engine/predefs17_2.asm"
INCLUDE "engine/hidden_object_functions17.asm"
@@ -1776,11 +1710,6 @@ INCLUDE "scripts/PokemonTower7F.asm"
INCLUDE "data/mapObjects/PokemonTower7F.asm"
PokemonTower7F_Blocks: INCBIN "maps/PokemonTower7F.blk"
-INCLUDE "data/mapHeaders/CeladonMart1F.asm"
-INCLUDE "scripts/CeladonMart1F.asm"
-INCLUDE "data/mapObjects/CeladonMart1F.asm"
-CeladonMart1F_Blocks: INCBIN "maps/CeladonMart1F.blk"
-
INCLUDE "engine/overworld/cinnabar_lab.asm"
INCLUDE "data/mapHeaders/ViridianForest.asm"
@@ -1854,6 +1783,7 @@ INCLUDE "engine/hidden_object_functions18.asm"
SECTION "bank19", ROMX
Overworld_GFX: INCBIN "gfx/tilesets/overworld.2bpp"
+ ds 32
Overworld_Block: INCBIN "gfx/blocksets/overworld.bst"
RedsHouse1_GFX:
@@ -1876,16 +1806,7 @@ Plateau_Block: INCBIN "gfx/blocksets/plateau.bst"
SECTION "bank1A", ROMX
-INCLUDE "engine/battle/decrement_pp.asm"
-
-Version_GFX:
-IF DEF(_RED)
- INCBIN "gfx/red/redgreenversion.1bpp" ; 10 tiles
-ENDC
-IF DEF(_BLUE)
- INCBIN "gfx/blue/blueversion.1bpp" ; 8 tiles
-ENDC
-Version_GFXEnd:
+INCBIN "gfx/blueversion.1bpp" ; unused
Dojo_GFX:
Gym_GFX: INCBIN "gfx/tilesets/gym.2bpp"
@@ -1908,7 +1829,6 @@ Forest_GFX: INCBIN "gfx/tilesets/forest.2bpp"
Forest_Block: INCBIN "gfx/blocksets/forest.bst"
Facility_GFX: INCBIN "gfx/tilesets/facility.2bpp"
Facility_Block: INCBIN "gfx/blocksets/facility.bst"
- ds 1
SECTION "bank1B", ROMX
@@ -1958,10 +1878,6 @@ FuchsiaPokecenter_Blocks: INCBIN "maps/FuchsiaPokecenter.blk"
CeruleanBadgeHouse_Blocks: INCBIN "maps/CeruleanBadgeHouse.blk"
-INCLUDE "engine/HoF_room_pc.asm"
-
-INCLUDE "engine/status_ailments.asm"
-
INCLUDE "engine/items/itemfinder.asm"
INCLUDE "scripts/CeruleanCity_2.asm"
@@ -2000,9 +1916,9 @@ INCLUDE "data/mapObjects/WardensHouse.asm"
WardensHouse_Blocks: INCBIN "maps/WardensHouse.blk"
INCLUDE "data/mapHeaders/SafariZoneGate.asm"
-INCLUDE "scripts/SafariZoneGate.asm"
INCLUDE "data/mapObjects/SafariZoneGate.asm"
SafariZoneGate_Blocks: INCBIN "maps/SafariZoneGate.blk"
+INCLUDE "scripts/SafariZoneGate.asm"
INCLUDE "data/mapHeaders/FuchsiaGym.asm"
INCLUDE "scripts/FuchsiaGym.asm"
@@ -2018,6 +1934,7 @@ INCLUDE "data/mapHeaders/CinnabarGym.asm"
INCLUDE "scripts/CinnabarGym.asm"
INCLUDE "data/mapObjects/CinnabarGym.asm"
CinnabarGym_Blocks: INCBIN "maps/CinnabarGym.blk"
+INCLUDE "scripts/CinnabarGym_2.asm"
INCLUDE "data/mapHeaders/CinnabarLab.asm"
INCLUDE "scripts/CinnabarLab.asm"
@@ -2073,6 +1990,8 @@ AgathasRoom_Blocks: INCBIN "maps/AgathasRoom.blk"
INCLUDE "engine/menu/league_pc.asm"
+INCLUDE "engine/overworld/elevator.asm"
+
INCLUDE "engine/overworld/hidden_items.asm"
@@ -2091,8 +2010,169 @@ RedFishingRodTiles: INCBIN "gfx/red_fishingrod_tiles.2bpp"
INCLUDE "data/animations.asm"
-INCLUDE "engine/evolution.asm"
-INCLUDE "engine/overworld/elevator.asm"
+SECTION "bank2f", ROMX
+
+INCLUDE "engine/bg_map_attributes.asm"
+
+
+SECTION "bank30", ROMX
+
+; This whole bank is garbage data.
+INCBIN "engine/bank30.bin"
+
+
+SECTION "bank39", 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 "bank3A", ROMX
+
+INCLUDE "text/monster_names.asm"
+
+INCLUDE "engine/overworld/is_player_just_outside_map.asm"
+
+INCLUDE "engine/printer.asm"
+INCLUDE "engine/diploma_3a.asm"
+
+SurfingPikachu3Graphics: INCBIN "gfx/surfing_pikachu_3.2bpp"
+SurfingPikachu3GraphicsEnd:
+
+INCLUDE "engine/unknown_ea3ea.asm"
+
+INCLUDE "engine/overworld/npc_movement_2.asm"
+
+; bank $3b is empty
+
+SECTION "bank3C", ROMX
+
+INCLUDE "engine/bank3c.asm"
+
+
+SECTION "bank3D", ROMX
+
+INCLUDE "engine/bank3d.asm"
+
+
+SECTION "bank3E", ROMX
+
+INCLUDE "engine/bank3e.asm"
+
+
+SECTION "bank3F", ROMX
-INCLUDE "engine/items/tm_prices.asm"
+INCLUDE "engine/bank3f.asm"
diff --git a/maps/BeachHouse.blk b/maps/BeachHouse.blk
new file mode 100644
index 00000000..5bcdb58a
--- /dev/null
+++ b/maps/BeachHouse.blk
@@ -0,0 +1 @@
+      \ No newline at end of file
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/UnusedPokecenterCopy.blk b/maps/UnusedPokecenterCopy.blk
index 9641efe4..dd54efd9 100755
--- 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/pic/bmon/abra.png b/pic/bmon/abra.png
deleted file mode 100644
index 12045ee3..00000000
--- a/pic/bmon/abra.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/aerodactyl.png b/pic/bmon/aerodactyl.png
deleted file mode 100644
index 4cbfdeeb..00000000
--- a/pic/bmon/aerodactyl.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/alakazam.png b/pic/bmon/alakazam.png
deleted file mode 100644
index 9c379b6a..00000000
--- a/pic/bmon/alakazam.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/arbok.png b/pic/bmon/arbok.png
deleted file mode 100644
index bd8da001..00000000
--- a/pic/bmon/arbok.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/arcanine.png b/pic/bmon/arcanine.png
deleted file mode 100644
index 5d25961d..00000000
--- a/pic/bmon/arcanine.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/articuno.png b/pic/bmon/articuno.png
deleted file mode 100644
index 66986add..00000000
--- a/pic/bmon/articuno.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/beedrill.png b/pic/bmon/beedrill.png
deleted file mode 100644
index 36b4a06f..00000000
--- a/pic/bmon/beedrill.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/bellsprout.png b/pic/bmon/bellsprout.png
deleted file mode 100644
index e4fc5e18..00000000
--- a/pic/bmon/bellsprout.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/blastoise.png b/pic/bmon/blastoise.png
deleted file mode 100644
index 2192b43a..00000000
--- a/pic/bmon/blastoise.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/bulbasaur.png b/pic/bmon/bulbasaur.png
deleted file mode 100644
index a2a924c7..00000000
--- a/pic/bmon/bulbasaur.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/butterfree.png b/pic/bmon/butterfree.png
deleted file mode 100644
index 8f1a69aa..00000000
--- a/pic/bmon/butterfree.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/caterpie.png b/pic/bmon/caterpie.png
deleted file mode 100644
index 8e1a49dd..00000000
--- a/pic/bmon/caterpie.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/chansey.png b/pic/bmon/chansey.png
deleted file mode 100644
index 832ba27c..00000000
--- a/pic/bmon/chansey.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/charizard.png b/pic/bmon/charizard.png
deleted file mode 100644
index ad29e489..00000000
--- a/pic/bmon/charizard.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/charmander.png b/pic/bmon/charmander.png
deleted file mode 100644
index 12d16f01..00000000
--- a/pic/bmon/charmander.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/charmeleon.png b/pic/bmon/charmeleon.png
deleted file mode 100644
index a5cff72f..00000000
--- a/pic/bmon/charmeleon.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/clefable.png b/pic/bmon/clefable.png
deleted file mode 100644
index 2fcfac0a..00000000
--- a/pic/bmon/clefable.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/clefairy.png b/pic/bmon/clefairy.png
deleted file mode 100644
index 5a7f3721..00000000
--- a/pic/bmon/clefairy.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/cloyster.png b/pic/bmon/cloyster.png
deleted file mode 100644
index 71f63a7f..00000000
--- a/pic/bmon/cloyster.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/cubone.png b/pic/bmon/cubone.png
deleted file mode 100644
index 23e3a23a..00000000
--- a/pic/bmon/cubone.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/dewgong.png b/pic/bmon/dewgong.png
deleted file mode 100644
index aac4e65c..00000000
--- a/pic/bmon/dewgong.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/diglett.png b/pic/bmon/diglett.png
deleted file mode 100644
index f92ae5bc..00000000
--- a/pic/bmon/diglett.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/ditto.png b/pic/bmon/ditto.png
deleted file mode 100644
index 4485e6ec..00000000
--- a/pic/bmon/ditto.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/dodrio.png b/pic/bmon/dodrio.png
deleted file mode 100644
index 92e6839d..00000000
--- a/pic/bmon/dodrio.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/doduo.png b/pic/bmon/doduo.png
deleted file mode 100644
index 20cba7ba..00000000
--- a/pic/bmon/doduo.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/dragonair.png b/pic/bmon/dragonair.png
deleted file mode 100644
index 55d1ef5b..00000000
--- a/pic/bmon/dragonair.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/dragonite.png b/pic/bmon/dragonite.png
deleted file mode 100644
index 4c387c3e..00000000
--- a/pic/bmon/dragonite.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/dratini.png b/pic/bmon/dratini.png
deleted file mode 100644
index 9df332e4..00000000
--- a/pic/bmon/dratini.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/drowzee.png b/pic/bmon/drowzee.png
deleted file mode 100644
index cc85510b..00000000
--- a/pic/bmon/drowzee.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/dugtrio.png b/pic/bmon/dugtrio.png
deleted file mode 100644
index 433f95ef..00000000
--- a/pic/bmon/dugtrio.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/eevee.png b/pic/bmon/eevee.png
deleted file mode 100644
index 956f8ce0..00000000
--- a/pic/bmon/eevee.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/ekans.png b/pic/bmon/ekans.png
deleted file mode 100644
index 6dffaf84..00000000
--- a/pic/bmon/ekans.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/electabuzz.png b/pic/bmon/electabuzz.png
deleted file mode 100644
index 0ddccbe1..00000000
--- a/pic/bmon/electabuzz.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/electrode.png b/pic/bmon/electrode.png
deleted file mode 100644
index 8df79e6a..00000000
--- a/pic/bmon/electrode.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/exeggcute.png b/pic/bmon/exeggcute.png
deleted file mode 100644
index 0ddf8e32..00000000
--- a/pic/bmon/exeggcute.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/exeggutor.png b/pic/bmon/exeggutor.png
deleted file mode 100644
index 89ccbdc4..00000000
--- a/pic/bmon/exeggutor.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/farfetchd.png b/pic/bmon/farfetchd.png
deleted file mode 100644
index 490e2b7c..00000000
--- a/pic/bmon/farfetchd.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/fearow.png b/pic/bmon/fearow.png
deleted file mode 100644
index c2c65257..00000000
--- a/pic/bmon/fearow.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/flareon.png b/pic/bmon/flareon.png
deleted file mode 100644
index eadebd27..00000000
--- a/pic/bmon/flareon.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/gastly.png b/pic/bmon/gastly.png
deleted file mode 100644
index 081b121d..00000000
--- a/pic/bmon/gastly.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/gengar.png b/pic/bmon/gengar.png
deleted file mode 100644
index 450662d7..00000000
--- a/pic/bmon/gengar.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/geodude.png b/pic/bmon/geodude.png
deleted file mode 100644
index 4202192a..00000000
--- a/pic/bmon/geodude.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/gloom.png b/pic/bmon/gloom.png
deleted file mode 100644
index c2ea9ba4..00000000
--- a/pic/bmon/gloom.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/golbat.png b/pic/bmon/golbat.png
deleted file mode 100644
index 6abc6f0a..00000000
--- a/pic/bmon/golbat.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/goldeen.png b/pic/bmon/goldeen.png
deleted file mode 100644
index e8cbfddc..00000000
--- a/pic/bmon/goldeen.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/golduck.png b/pic/bmon/golduck.png
deleted file mode 100644
index 5448f7c8..00000000
--- a/pic/bmon/golduck.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/golem.png b/pic/bmon/golem.png
deleted file mode 100644
index 1dba6a67..00000000
--- a/pic/bmon/golem.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/graveler.png b/pic/bmon/graveler.png
deleted file mode 100644
index 0d9da672..00000000
--- a/pic/bmon/graveler.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/grimer.png b/pic/bmon/grimer.png
deleted file mode 100644
index 255b10b9..00000000
--- a/pic/bmon/grimer.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/growlithe.png b/pic/bmon/growlithe.png
deleted file mode 100644
index b753bce7..00000000
--- a/pic/bmon/growlithe.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/gyarados.png b/pic/bmon/gyarados.png
deleted file mode 100644
index a7ed0c17..00000000
--- a/pic/bmon/gyarados.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/haunter.png b/pic/bmon/haunter.png
deleted file mode 100644
index 4d6c758d..00000000
--- a/pic/bmon/haunter.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/hitmonchan.png b/pic/bmon/hitmonchan.png
deleted file mode 100644
index d8a6ffd3..00000000
--- a/pic/bmon/hitmonchan.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/hitmonlee.png b/pic/bmon/hitmonlee.png
deleted file mode 100644
index 36042c68..00000000
--- a/pic/bmon/hitmonlee.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/horsea.png b/pic/bmon/horsea.png
deleted file mode 100644
index cd28df8c..00000000
--- a/pic/bmon/horsea.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/hypno.png b/pic/bmon/hypno.png
deleted file mode 100644
index e7434ea4..00000000
--- a/pic/bmon/hypno.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/ivysaur.png b/pic/bmon/ivysaur.png
deleted file mode 100644
index dad10ae0..00000000
--- a/pic/bmon/ivysaur.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/jigglypuff.png b/pic/bmon/jigglypuff.png
deleted file mode 100644
index a5475777..00000000
--- a/pic/bmon/jigglypuff.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/jolteon.png b/pic/bmon/jolteon.png
deleted file mode 100644
index 7ecd6fbb..00000000
--- a/pic/bmon/jolteon.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/jynx.png b/pic/bmon/jynx.png
deleted file mode 100644
index 583bd5da..00000000
--- a/pic/bmon/jynx.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/kabuto.png b/pic/bmon/kabuto.png
deleted file mode 100644
index e8e44e15..00000000
--- a/pic/bmon/kabuto.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/kabutops.png b/pic/bmon/kabutops.png
deleted file mode 100644
index 39fcb900..00000000
--- a/pic/bmon/kabutops.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/kadabra.png b/pic/bmon/kadabra.png
deleted file mode 100644
index 36589440..00000000
--- a/pic/bmon/kadabra.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/kakuna.png b/pic/bmon/kakuna.png
deleted file mode 100644
index ee350ffd..00000000
--- a/pic/bmon/kakuna.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/kangaskhan.png b/pic/bmon/kangaskhan.png
deleted file mode 100644
index 1c0ba99c..00000000
--- a/pic/bmon/kangaskhan.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/kingler.png b/pic/bmon/kingler.png
deleted file mode 100644
index b2bd7418..00000000
--- a/pic/bmon/kingler.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/koffing.png b/pic/bmon/koffing.png
deleted file mode 100644
index 36961502..00000000
--- a/pic/bmon/koffing.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/krabby.png b/pic/bmon/krabby.png
deleted file mode 100644
index b280e8db..00000000
--- a/pic/bmon/krabby.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/lapras.png b/pic/bmon/lapras.png
deleted file mode 100644
index 822c00e9..00000000
--- a/pic/bmon/lapras.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/lickitung.png b/pic/bmon/lickitung.png
deleted file mode 100644
index 050f7d23..00000000
--- a/pic/bmon/lickitung.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/machamp.png b/pic/bmon/machamp.png
deleted file mode 100644
index c854a2cf..00000000
--- a/pic/bmon/machamp.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/machoke.png b/pic/bmon/machoke.png
deleted file mode 100644
index 317dad96..00000000
--- a/pic/bmon/machoke.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/machop.png b/pic/bmon/machop.png
deleted file mode 100644
index 63909c11..00000000
--- a/pic/bmon/machop.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/magikarp.png b/pic/bmon/magikarp.png
deleted file mode 100644
index e71402f8..00000000
--- a/pic/bmon/magikarp.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/magmar.png b/pic/bmon/magmar.png
deleted file mode 100644
index 9bc1d929..00000000
--- a/pic/bmon/magmar.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/magnemite.png b/pic/bmon/magnemite.png
deleted file mode 100644
index f2254bed..00000000
--- a/pic/bmon/magnemite.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/magneton.png b/pic/bmon/magneton.png
deleted file mode 100644
index 4d0f2cc7..00000000
--- a/pic/bmon/magneton.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/mankey.png b/pic/bmon/mankey.png
deleted file mode 100644
index 303ce1f2..00000000
--- a/pic/bmon/mankey.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/marowak.png b/pic/bmon/marowak.png
deleted file mode 100644
index b2d18437..00000000
--- a/pic/bmon/marowak.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/meowth.png b/pic/bmon/meowth.png
deleted file mode 100644
index 0e706c35..00000000
--- a/pic/bmon/meowth.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/metapod.png b/pic/bmon/metapod.png
deleted file mode 100644
index cbfa6e1e..00000000
--- a/pic/bmon/metapod.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/mew.png b/pic/bmon/mew.png
deleted file mode 100644
index 7e25a96d..00000000
--- a/pic/bmon/mew.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/mewtwo.png b/pic/bmon/mewtwo.png
deleted file mode 100644
index b7a31296..00000000
--- a/pic/bmon/mewtwo.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/moltres.png b/pic/bmon/moltres.png
deleted file mode 100644
index 7c153998..00000000
--- a/pic/bmon/moltres.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/mr.mime.png b/pic/bmon/mr.mime.png
deleted file mode 100644
index d9085ec6..00000000
--- a/pic/bmon/mr.mime.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/muk.png b/pic/bmon/muk.png
deleted file mode 100644
index f69b83b7..00000000
--- a/pic/bmon/muk.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/nidoking.png b/pic/bmon/nidoking.png
deleted file mode 100644
index 24330538..00000000
--- a/pic/bmon/nidoking.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/nidoqueen.png b/pic/bmon/nidoqueen.png
deleted file mode 100644
index c0043e1b..00000000
--- a/pic/bmon/nidoqueen.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/nidoranf.png b/pic/bmon/nidoranf.png
deleted file mode 100644
index 6b58b274..00000000
--- a/pic/bmon/nidoranf.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/nidoranm.png b/pic/bmon/nidoranm.png
deleted file mode 100644
index 92d0cb49..00000000
--- a/pic/bmon/nidoranm.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/nidorina.png b/pic/bmon/nidorina.png
deleted file mode 100644
index 68aca7c4..00000000
--- a/pic/bmon/nidorina.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/nidorino.png b/pic/bmon/nidorino.png
deleted file mode 100644
index 795bf0c5..00000000
--- a/pic/bmon/nidorino.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/ninetales.png b/pic/bmon/ninetales.png
deleted file mode 100644
index ed6bb398..00000000
--- a/pic/bmon/ninetales.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/oddish.png b/pic/bmon/oddish.png
deleted file mode 100644
index e47dabe1..00000000
--- a/pic/bmon/oddish.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/omanyte.png b/pic/bmon/omanyte.png
deleted file mode 100644
index bdfa5440..00000000
--- a/pic/bmon/omanyte.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/omastar.png b/pic/bmon/omastar.png
deleted file mode 100644
index 3221d3d8..00000000
--- a/pic/bmon/omastar.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/onix.png b/pic/bmon/onix.png
deleted file mode 100644
index 44a21a61..00000000
--- a/pic/bmon/onix.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/paras.png b/pic/bmon/paras.png
deleted file mode 100644
index f4909bbd..00000000
--- a/pic/bmon/paras.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/parasect.png b/pic/bmon/parasect.png
deleted file mode 100644
index 938bf53b..00000000
--- a/pic/bmon/parasect.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/persian.png b/pic/bmon/persian.png
deleted file mode 100644
index cc15677a..00000000
--- a/pic/bmon/persian.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/pidgeot.png b/pic/bmon/pidgeot.png
deleted file mode 100644
index 7daf609f..00000000
--- a/pic/bmon/pidgeot.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/pidgeotto.png b/pic/bmon/pidgeotto.png
deleted file mode 100644
index c86b86f1..00000000
--- a/pic/bmon/pidgeotto.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/pidgey.png b/pic/bmon/pidgey.png
deleted file mode 100644
index 70d9dd4a..00000000
--- a/pic/bmon/pidgey.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/pikachu.png b/pic/bmon/pikachu.png
deleted file mode 100644
index 159e47e9..00000000
--- a/pic/bmon/pikachu.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/pinsir.png b/pic/bmon/pinsir.png
deleted file mode 100644
index 320c79cb..00000000
--- a/pic/bmon/pinsir.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/poliwag.png b/pic/bmon/poliwag.png
deleted file mode 100644
index 397d2e66..00000000
--- a/pic/bmon/poliwag.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/poliwhirl.png b/pic/bmon/poliwhirl.png
deleted file mode 100644
index a7039145..00000000
--- a/pic/bmon/poliwhirl.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/poliwrath.png b/pic/bmon/poliwrath.png
deleted file mode 100644
index f31d0680..00000000
--- a/pic/bmon/poliwrath.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/ponyta.png b/pic/bmon/ponyta.png
deleted file mode 100644
index 4d8c1bee..00000000
--- a/pic/bmon/ponyta.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/porygon.png b/pic/bmon/porygon.png
deleted file mode 100644
index ba3500c6..00000000
--- a/pic/bmon/porygon.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/primeape.png b/pic/bmon/primeape.png
deleted file mode 100644
index 7c5a1a09..00000000
--- a/pic/bmon/primeape.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/psyduck.png b/pic/bmon/psyduck.png
deleted file mode 100644
index 86772256..00000000
--- a/pic/bmon/psyduck.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/raichu.png b/pic/bmon/raichu.png
deleted file mode 100644
index a29731e5..00000000
--- a/pic/bmon/raichu.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/rapidash.png b/pic/bmon/rapidash.png
deleted file mode 100644
index 62d47506..00000000
--- a/pic/bmon/rapidash.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/raticate.png b/pic/bmon/raticate.png
deleted file mode 100644
index 64340846..00000000
--- a/pic/bmon/raticate.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/rattata.png b/pic/bmon/rattata.png
deleted file mode 100644
index 9b391cca..00000000
--- a/pic/bmon/rattata.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/rhydon.png b/pic/bmon/rhydon.png
deleted file mode 100644
index 92406476..00000000
--- a/pic/bmon/rhydon.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/rhyhorn.png b/pic/bmon/rhyhorn.png
deleted file mode 100644
index 9452b701..00000000
--- a/pic/bmon/rhyhorn.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/sandshrew.png b/pic/bmon/sandshrew.png
deleted file mode 100644
index bcf52215..00000000
--- a/pic/bmon/sandshrew.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/sandslash.png b/pic/bmon/sandslash.png
deleted file mode 100644
index 3b212a60..00000000
--- a/pic/bmon/sandslash.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/scyther.png b/pic/bmon/scyther.png
deleted file mode 100644
index 3fe6eeae..00000000
--- a/pic/bmon/scyther.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/seadra.png b/pic/bmon/seadra.png
deleted file mode 100644
index e8af292f..00000000
--- a/pic/bmon/seadra.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/seaking.png b/pic/bmon/seaking.png
deleted file mode 100644
index ebe70c7e..00000000
--- a/pic/bmon/seaking.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/seel.png b/pic/bmon/seel.png
deleted file mode 100644
index c4b2315a..00000000
--- a/pic/bmon/seel.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/shellder.png b/pic/bmon/shellder.png
deleted file mode 100644
index cf44a7fe..00000000
--- a/pic/bmon/shellder.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/slowbro.png b/pic/bmon/slowbro.png
deleted file mode 100644
index e61ad34b..00000000
--- a/pic/bmon/slowbro.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/slowpoke.png b/pic/bmon/slowpoke.png
deleted file mode 100644
index fdf701d7..00000000
--- a/pic/bmon/slowpoke.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/snorlax.png b/pic/bmon/snorlax.png
deleted file mode 100644
index 5b571a18..00000000
--- a/pic/bmon/snorlax.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/spearow.png b/pic/bmon/spearow.png
deleted file mode 100644
index 835800a5..00000000
--- a/pic/bmon/spearow.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/squirtle.png b/pic/bmon/squirtle.png
deleted file mode 100644
index bc0c9979..00000000
--- a/pic/bmon/squirtle.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/starmie.png b/pic/bmon/starmie.png
deleted file mode 100644
index 24025ddf..00000000
--- a/pic/bmon/starmie.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/staryu.png b/pic/bmon/staryu.png
deleted file mode 100644
index 394732e9..00000000
--- a/pic/bmon/staryu.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/tangela.png b/pic/bmon/tangela.png
deleted file mode 100644
index eff9c5a5..00000000
--- a/pic/bmon/tangela.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/tauros.png b/pic/bmon/tauros.png
deleted file mode 100644
index 3a4edfee..00000000
--- a/pic/bmon/tauros.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/tentacool.png b/pic/bmon/tentacool.png
deleted file mode 100644
index 534e5496..00000000
--- a/pic/bmon/tentacool.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/tentacruel.png b/pic/bmon/tentacruel.png
deleted file mode 100644
index 7a26a305..00000000
--- a/pic/bmon/tentacruel.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/vaporeon.png b/pic/bmon/vaporeon.png
deleted file mode 100644
index 48dafce6..00000000
--- a/pic/bmon/vaporeon.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/venomoth.png b/pic/bmon/venomoth.png
deleted file mode 100644
index e28b1017..00000000
--- a/pic/bmon/venomoth.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/venonat.png b/pic/bmon/venonat.png
deleted file mode 100644
index edf15889..00000000
--- a/pic/bmon/venonat.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/venusaur.png b/pic/bmon/venusaur.png
deleted file mode 100644
index dd39184a..00000000
--- a/pic/bmon/venusaur.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/victreebel.png b/pic/bmon/victreebel.png
deleted file mode 100644
index 29a471c8..00000000
--- a/pic/bmon/victreebel.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/vileplume.png b/pic/bmon/vileplume.png
deleted file mode 100644
index e788425e..00000000
--- a/pic/bmon/vileplume.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/voltorb.png b/pic/bmon/voltorb.png
deleted file mode 100644
index 22d0c675..00000000
--- a/pic/bmon/voltorb.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/vulpix.png b/pic/bmon/vulpix.png
deleted file mode 100644
index f4780ef2..00000000
--- a/pic/bmon/vulpix.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/wartortle.png b/pic/bmon/wartortle.png
deleted file mode 100644
index bd844562..00000000
--- a/pic/bmon/wartortle.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/weedle.png b/pic/bmon/weedle.png
deleted file mode 100644
index 445fe8f3..00000000
--- a/pic/bmon/weedle.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/weepinbell.png b/pic/bmon/weepinbell.png
deleted file mode 100644
index 6ee57334..00000000
--- a/pic/bmon/weepinbell.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/weezing.png b/pic/bmon/weezing.png
deleted file mode 100644
index deb2a623..00000000
--- a/pic/bmon/weezing.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/wigglytuff.png b/pic/bmon/wigglytuff.png
deleted file mode 100644
index c7cd495b..00000000
--- a/pic/bmon/wigglytuff.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/zapdos.png b/pic/bmon/zapdos.png
deleted file mode 100644
index 0bd71f4e..00000000
--- a/pic/bmon/zapdos.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/zubat.png b/pic/bmon/zubat.png
deleted file mode 100644
index 73078725..00000000
--- a/pic/bmon/zubat.png
+++ /dev/null
Binary files differ
diff --git a/pic/bmon/fossilaerodactyl.png b/pic/ymon/fossilaerodactyl.png
index eb7fc3a3..eb7fc3a3 100644
--- a/pic/bmon/fossilaerodactyl.png
+++ b/pic/ymon/fossilaerodactyl.png
Binary files differ
diff --git a/pic/bmon/fossilkabutops.png b/pic/ymon/fossilkabutops.png
index dd8d41ea..dd8d41ea 100644
--- a/pic/bmon/fossilkabutops.png
+++ b/pic/ymon/fossilkabutops.png
Binary files differ
diff --git a/pokered.sn1 b/pokered.sn1
deleted file mode 100644
index 7ff6d501..00000000
--- a/pokered.sn1
+++ /dev/null
Binary files differ
diff --git a/pokered.link b/pokeyellow.link
index 2c110d4c..60b2beaf 100644
--- a/pokered.link
+++ b/pokeyellow.link
@@ -66,14 +66,12 @@ ROMX $3
ROMX $4
org $4000
- "NPC Sprites 1" ; NPC_SPRITES_1
- "Graphics (BANK 4)" ; GFX
- "Battle (BANK 4)"
+ "Graphics (BANK 4)"
+ "NPC Sprites 1"
ROMX $5
org $4000
- "NPC Sprites 2" ; NPC_SPRITES_2
- "Battle (BANK 5)"
+ "NPC Sprites 2"
ROMX $6
org $4000
@@ -93,28 +91,23 @@ ROMX $8
ROMX $9
org $4000
- "Pics 1" ; PICS_1
- "Battle (BANK 9)"
+ "Pics 1"
ROMX $A
org $4000
- "Pics 2" ; PICS_2
- "Battle (BANK A)"
+ "Pics 2"
ROMX $B
org $4000
- "Pics 3" ; PICS_3
- "Battle (BANK B)"
+ "Pics 3"
ROMX $C
org $4000
- "Pics 4" ; PICS_4
- "Battle (BANK C)"
+ "Pics 4"
ROMX $D
org $4000
- "Pics 5" ; PICS_5
- "Battle (BANK D)"
+ "Pics 5"
ROMX $E
org $4000
@@ -194,80 +187,159 @@ ROMX $1F
ROMX $20
org $4000
- "Text 1" ; TEXT_1
+ "Sound Effect Headers 4" ; AUDIO_4
+ "Music Headers 4"
+ "Sound Effects 4"
+ "Audio Engine 4"
+ "Music 4"
ROMX $21
org $4000
- "Text 2" ; TEXT_2
+ "Pikachu Cries 1"
ROMX $22
org $4000
- "Text 3" ; TEXT_3
+ "Pikachu Cries 2"
ROMX $23
org $4000
- "Text 4" ; TEXT_4
+ "Pikachu Cries 3"
ROMX $24
org $4000
- "Text 5" ; TEXT_5
+ "Pikachu Cries 4"
ROMX $25
org $4000
- "Text 6" ; TEXT_6
+ "Pikachu Cries 5"
ROMX $26
org $4000
- "Text 7" ; TEXT_7
+ "Text 1"
ROMX $27
org $4000
- "Text 8" ; TEXT_8
+ "Text 2"
ROMX $28
org $4000
- "Text 9" ; TEXT_9
+ "Text 3"
ROMX $29
org $4000
- "Text 10" ; TEXT_10
+ "Text 4"
ROMX $2A
org $4000
- "Text 11" ; TEXT_11
+ "Text 5"
ROMX $2B
org $4000
- "Pokedex Text" ; POKEDEX_TEXT
+ "Text 6"
ROMX $2C
org $4000
- "Move Names" ; MOVE_NAMES
+ "Text 7"
+
+ROMX $2D
+ org $4000
+ "Text 8"
+
+ROMX $2E
+ org $4000
+ "Pokedex Text"
+
+ROMX $2f
+ org $4000
+ "Move Names"
+ org $5000
+ "bank2f"
+
+ROMX $30
+ org $4000
+ "bank30"
+
+ROMX $31
+ org $4000
+ "Pikachu Cries 6"
+
+ROMX $32
+ org $4000
+ "Pikachu Cries 7"
+
+ROMX $33
+ org $4000
+ "Pikachu Cries 8"
+
+ROMX $34
+ org $4000
+ "Pikachu Cries 9"
+
+ROMX $35
+ org $4000
+ "Pikachu Cries 10"
+
+ROMX $36
+ org $4000
+ "Pikachu Cries 11"
+
+ROMX $37
+ org $4000
+ "Pikachu Cries 12"
+
+ROMX $38
+ org $4000
+ "Pikachu Cries 13"
+
+ROMX $39
+ org $4000
+ "bank39"
+
+ROMX $3A
+ org $4000
+ "bank3A"
+
+; bank $3b is empty
+
+ROMX $3C
+ org $4000
+ "bank3C"
+
+ROMX $3D
+ org $4000
+ "bank3D"
+
+ROMX $3E
+ org $4000
+ "bank3E"
+
+ROMX $3F
+ org $4000
+ "bank3F"
WRAM0
org $c000
"WRAM Bank 0"
-
org $c100
"Sprite State Data"
+ org $c300
"OAM Buffer"
+WRAMX 1
+ org $d000
+ "WRAM Bank 1"
org $dfff
"Stack"
SRAM 0
- org $a000
"Sprite Buffers"
SRAM 1
- org $a000
"Save Data"
SRAM 2
- org $a000
"Saved Boxes 1"
SRAM 3
- org $a000
"Saved Boxes 2"
diff --git a/replace.sh b/replace.sh
new file mode 100644
index 00000000..fe0e1ffb
--- /dev/null
+++ b/replace.sh
@@ -0,0 +1,3 @@
+sed -i 's/\<'$1'\>/'$2'/' $(grep -lwr --include "*.asm" --exclude-dir=".git" --exclude-dir="extras" --exclude-dir="pic" --exclude-dir="gfx" $1)
+# $1: phrase to find
+# $2: phrase to replace $1 \ No newline at end of file
diff --git a/roms.md5 b/roms.md5
index c4128cfd..6b047539 100644
--- a/roms.md5
+++ b/roms.md5
@@ -1,2 +1 @@
-3d45c1ee9abd5738df46d2bdda8b57dc pokered.gbc
-50927e843568814f7ed45ec4f944bd8b pokeblue.gbc
+d9290db87b1f0a23b89f99ee4469e34b pokeyellow.gbc
diff --git a/scripts/AgathasRoom.asm b/scripts/AgathasRoom.asm
index a1dba196..20245166 100755
--- a/scripts/AgathasRoom.asm
+++ b/scripts/AgathasRoom.asm
@@ -20,7 +20,8 @@ AgathaShowOrHideExitBlock:
jp .setExitBlock
.blockExitToNextRoom
ld a, $3b
-.setExitBlock:
+
+.setExitBlock
ld [wNewTileBlockID], a
lb bc, 0, 2
predef_jump ReplaceTileBlock
diff --git a/scripts/BeachHouse.asm b/scripts/BeachHouse.asm
new file mode 100644
index 00000000..6a67c7ab
--- /dev/null
+++ b/scripts/BeachHouse.asm
@@ -0,0 +1,191 @@
+BeachHouse_Script:
+ call EnableAutoTextBoxDrawing
+ ret
+
+BeachHouse_TextPointers:
+ dw SurfinDudeText
+ dw BeachHousePikachuText
+ dw BeachHouseSign1Text
+ dw BeachHouseSign2Text
+ dw BeachHouseSign3Text
+ dw BeachHouseSign4Text
+
+SurfinDudeText:
+ TX_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
+ callba SurfingPikachuMinigame
+ ld hl, wd492
+ set 1, [hl]
+ jr .done
+.asm_f226b
+ ld hl, .SurfinDudeText2
+ call PrintText
+.done
+ jp TextScriptEnd
+
+.SurfinDudeText1
+ TX_FAR _SurfinDudeText1
+ db "@"
+.SurfinDudeText2
+ TX_FAR _SurfinDudeText2
+ db "@"
+.SurfinDudeText3
+ TX_FAR _SurfinDudeText3
+ db "@"
+.SurfinDudeText4
+ TX_FAR _SurfinDudeText4
+ db "@"
+
+BeachHousePikachuText:
+ TX_ASM
+ ld hl, .BeachHousePikachuText
+ call PrintText
+ ld a, PIKACHU
+ call PlayCry
+ call WaitForSoundToFinish
+ jp TextScriptEnd
+
+.BeachHousePikachuText
+ TX_FAR _BeachHousePikachuText
+ db "@"
+
+BeachHouseSign1Text:
+ TX_ASM
+ ld hl, .BeachHouseSign1Text2
+ ld a, [wd472]
+ bit 6, a
+ jr z, .next
+ ld hl, .BeachHouseSign1Text1
+.next
+ call PrintText
+ jp TextScriptEnd
+
+.BeachHouseSign1Text1
+ TX_FAR _BeachHouseSign1Text1
+ db "@"
+.BeachHouseSign1Text2
+ TX_FAR _BeachHouseSign1Text2
+ db "@"
+
+BeachHouseSign2Text:
+ TX_ASM
+ ld hl, .BeachHouseSign2Text2
+ ld a, [wd472]
+ bit 6, a
+ jr z, .next
+ ld hl, .BeachHouseSign2Text1
+.next
+ call PrintText
+ jp TextScriptEnd
+
+.BeachHouseSign2Text1
+ TX_FAR _BeachHouseSign2Text1
+ db "@"
+.BeachHouseSign2Text2
+ TX_FAR _BeachHouseSign2Text2
+ db "@"
+
+BeachHouseSign3Text:
+ TX_ASM
+ ld hl, .BeachHouseSign3Text2
+ ld a, [wd472]
+ bit 6, a
+ jr z, .next
+ ld hl, .BeachHouseSign3Text1
+.next
+ call PrintText
+ jp TextScriptEnd
+
+.BeachHouseSign3Text1
+ TX_FAR _BeachHouseSign3Text1
+ db "@"
+.BeachHouseSign3Text2
+ TX_FAR _BeachHouseSign3Text2
+ db "@"
+
+BeachHouseSign4Text:
+ TX_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, .BeachHousePrinterText2
+ call PrintText
+ ld a, [wd492]
+ bit 1, a
+ jr z, .asm_f236f
+
+ ld a, 1
+ ld [wDoNotWaitForButtonPressAfterDisplayingText], a
+ ld hl, .BeachHousePrinterText3
+ 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
+ callab 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, .BeachHousePrinterText1
+ call PrintText
+.asm_f236f
+ jp TextScriptEnd
+
+.BeachHousePrinterText1
+ TX_FAR _BeachHousePrinterText1
+ db $d, "@"
+.BeachHousePrinterText2
+ TX_FAR _BeachHousePrinterText2
+ db $d, "@"
+.BeachHousePrinterText3
+ TX_FAR _BeachHousePrinterText3
+ db "@"
+.BeachHousePrinterText4
+ TX_FAR _BeachHousePrinterText4
+ db "@"
diff --git a/scripts/BeachHouse2.asm b/scripts/BeachHouse2.asm
new file mode 100755
index 00000000..a5b7e7be
--- /dev/null
+++ b/scripts/BeachHouse2.asm
@@ -0,0 +1,33 @@
+Func_f23d0:
+ call SaveScreenTilesToBuffer2
+ xor a
+ ld [wUpdateSpritesEnabled], a
+ ld hl, wd730
+ set 6, [hl]
+ callab PrintSurfingMinigameHighScore
+ ld hl, wd730
+ res 6, [hl]
+ call GBPalWhiteOutWithDelay3
+ call ReloadTilesetTilePatterns
+ call RestoreScreenTilesAndReloadTilePatterns
+ call LoadScreenTilesFromBuffer2
+ call Delay3
+ call GBPalNormal
+ ld hl, Text_f2412
+ ld a, [hOaksAideResult]
+ and a
+ jr nz, .asm_f2406
+ ld hl, Text_f240c
+.asm_f2406
+ call PrintText
+ jp TextScriptEnd
+
+Text_f240c:
+ TX_FAR _BeachHousePrinterText5
+ TX_WAIT
+ db "@"
+
+Text_f2412:
+ TX_FAR _BeachHousePrinterText6
+ TX_WAIT
+ db "@"
diff --git a/scripts/BikeShop.asm b/scripts/BikeShop.asm
index 71149759..a554cf7c 100755
--- a/scripts/BikeShop.asm
+++ b/scripts/BikeShop.asm
@@ -1,5 +1,6 @@
BikeShop_Script:
- jp EnableAutoTextBoxDrawing
+ call EnableAutoTextBoxDrawing
+ ret
BikeShop_TextPointers:
dw BikeShopText1
@@ -13,6 +14,7 @@ BikeShopText1:
ld hl, BikeShopText_1d82f
call PrintText
jp .Done
+
.asm_260d4
ld b, BIKE_VOUCHER
call IsItemInBag
@@ -29,10 +31,12 @@ BikeShopText1:
ld hl, BikeShopText_1d824
call PrintText
jr .Done
+
.BagFull
ld hl, BikeShopText_1d834
call PrintText
jr .Done
+
.asm_41190
ld hl, BikeShopText_1d810
call PrintText
@@ -50,8 +54,7 @@ BikeShopText1:
ld hl, wd730
set 6, [hl]
coord hl, 0, 0
- ld b, $4
- ld c, $f
+ lb bc, 4, 15
call TextBoxBorder
call UpdateSprites
coord hl, 2, 2
@@ -62,11 +65,12 @@ BikeShopText1:
call PlaceString
ld hl, BikeShopText_1d815
call PrintText
- call HandleMenuInput
- bit 1, a
- jr nz, .cancel
+ ; This fixes the bike shop instatext glitch
ld hl, wd730
res 6, [hl]
+ call HandleMenuInput
+ bit BIT_B_BUTTON, a
+ jr nz, .cancel
ld a, [wCurrentMenuItem]
and a
jr nz, .cancel
diff --git a/scripts/BillsHouse.asm b/scripts/BillsHouse.asm
index 74efc960..a9e09947 100755
--- 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
+ callab CheckPikachuFaintedOrStatused
+ jr c, .asm_1e0d2
+ callab Func_f24d5
+.asm_1e0d2
+ xor a
+ ld [wJoyIgnore], a
+ ld a, $1
+ ld [wBillsHouseCurScript], a
ret
BillsHouseScript1:
- ld a, [wSpriteStateData1 + 9]
+ 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
+ callab Func_f250b
+.asm_1e0f8
ld de, MovementData_1e7a0
.notDown
ld a, $1
ld [H_SPRITEINDEX], a
call MoveSprite
- ld a, $2
+ ld a, $3
ld [wBillsHouseCurScript], a
ret
@@ -44,25 +89,58 @@ MovementData_1e7a0:
db NPC_MOVEMENT_UP
db $FF
-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
+ callab 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
+ ld [H_SPRITEINDEX], a
+ ld a, SPRITE_FACING_DOWN
+ ld [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
+ callab InitializePikachuTextID
+.asm_1e1c6
ld a, $2
ld [H_SPRITEINDEX], 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 $FF
-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
+ ld [H_SPRITEINDEX], a
+ ld a, SPRITE_FACING_DOWN
+ ld [hSpriteFacingDirection], a
+ call SetSpriteFacingDirectionAndDelay
+ xor a
+ ld [wJoyIgnore], a
+ ld a, $2
ld [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:
- TX_BILLS_PC
+ TX_FAR _BillsHouseDontLeaveText
+ db "@"
BillsHouseText1:
TX_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
+ callba Func_f2418
jp TextScriptEnd
-BillsHouseText_1e865:
- TX_FAR _BillsHouseText_1e865
- db "@"
-
-BillsHouseText_1e86a:
- TX_FAR _BillsHouseText_1e86a
- db "@"
-
-BillsHouseText_1e86f:
- TX_FAR _BillsHouseText_1e86f
- db "@"
-
BillsHouseText2:
TX_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
+ callba Func_f244a
jp TextScriptEnd
-BillThankYouText:
- TX_FAR _BillThankYouText
- db "@"
-
-SSTicketReceivedText:
- TX_FAR _SSTicketReceivedText
- TX_SFX_KEY_ITEM
- TX_BLINK
- db "@"
-
-SSTicketNoRoomText:
- TX_FAR _SSTicketNoRoomText
- db "@"
-
-BillsHouseText_1e8cb:
- TX_FAR _BillsHouseText_1e8cb
- db "@"
-
BillsHouseText3:
TX_ASM
- ld hl, BillsHouseText_1e8da
- call PrintText
+ callba Func_f24a2
jp TextScriptEnd
-
-BillsHouseText_1e8da:
- TX_FAR _BillsHouseText_1e8da
- db "@"
diff --git a/scripts/BillsHouse2.asm b/scripts/BillsHouse2.asm
new file mode 100755
index 00000000..ce474004
--- /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:
+ TX_FAR _BillsHouseText_1e865
+ db "@"
+
+BillsHouseText_f2440:
+ TX_FAR _BillsHouseText_1e86a
+ db "@"
+
+BillsHouseText_f2445:
+ TX_FAR _BillsHouseText_1e86f
+ db "@"
+
+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:
+ TX_FAR _BillThankYouText
+ db "@"
+
+BillsHouseText_f2491:
+ TX_FAR _SSTicketReceivedText
+ TX_SFX_KEY_ITEM
+ TX_BLINK
+ db "@"
+
+BillsHouseText_f2498:
+ TX_FAR _SSTicketNoRoomText
+ db "@"
+
+BillsHouseText_f249d:
+ TX_FAR _BillsHouseText_1e8cb
+ db "@"
+
+Func_f24a2:
+ ld hl, BillsHouseText_f24a9
+ call PrintText
+ ret
+
+BillsHouseText_f24a9:
+ TX_FAR _BillsHouseText_1e8da
+ db "@"
+
+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
+ callab 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 f325049f..471e6989 100755
--- 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
@@ -14,8 +15,6 @@ BluesHouseScript0:
; trigger the next script
ld a, 1
ld [wBluesHouseCurScript], a
- ret
-
BluesHouseScript1:
ret
@@ -33,7 +32,6 @@ BluesHouseText1:
ld hl, DaisyInitialText
call PrintText
jr .done
-
.GiveMap
ld hl, DaisyOfferMapText
call PrintText
@@ -47,12 +45,10 @@ BluesHouseText1:
call PrintText
SetEvent EVENT_GOT_TOWN_MAP
jr .done
-
.GotMap
ld hl, DaisyUseMapText
call PrintText
jr .done
-
.BagFull
ld hl, DaisyBagFullText
call PrintText
diff --git a/scripts/BrunosRoom.asm b/scripts/BrunosRoom.asm
index 3b6385b7..a525e5bb 100755
--- a/scripts/BrunosRoom.asm
+++ b/scripts/BrunosRoom.asm
@@ -20,6 +20,7 @@ BrunoShowOrHideExitBlock:
jp .setExitBlock
.blockExitToNextRoom
ld a, $24
+
.setExitBlock
ld [wNewTileBlockID], a
lb bc, 0, 2
diff --git a/scripts/CeladonCity.asm b/scripts/CeladonCity.asm
index e2d7d371..bd49f5af 100755
--- 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:
db "@"
CeladonCityText10:
- TX_FAR _CeladonCityText10
- db "@"
+ TX_ASM
+ callba Func_f1ac6
+ jp TextScriptEnd
CeladonCityText11:
TX_FAR _CeladonCityText11
diff --git a/scripts/CeladonCity2.asm b/scripts/CeladonCity2.asm
new file mode 100755
index 00000000..12f7b366
--- /dev/null
+++ b/scripts/CeladonCity2.asm
@@ -0,0 +1,8 @@
+Func_f1ac6:
+ ld hl, Text_f1acd
+ call PrintText
+ ret
+
+Text_f1acd:
+ TX_FAR _CeladonCityText10
+ db "@"
diff --git a/scripts/CeladonDiner.asm b/scripts/CeladonDiner.asm
index 371205de..f444ec15 100755
--- a/scripts/CeladonDiner.asm
+++ b/scripts/CeladonDiner.asm
@@ -27,40 +27,5 @@ CeladonDinerText4:
CeladonDinerText5:
TX_ASM
- CheckEvent EVENT_GOT_COIN_CASE
- jr nz, .asm_eb14d
- ld hl, CeladonDinerText_491a7
- call PrintText
- lb bc, COIN_CASE, 1
- call GiveItem
- jr nc, .BagFull
- SetEvent EVENT_GOT_COIN_CASE
- ld hl, ReceivedCoinCaseText
- call PrintText
- jr .asm_68b61
-.BagFull
- ld hl, CoinCaseNoRoomText
- call PrintText
- jr .asm_68b61
-.asm_eb14d
- ld hl, CeladonDinerText_491b7
- call PrintText
-.asm_68b61
+ callab Func_f1f31
jp TextScriptEnd
-
-CeladonDinerText_491a7:
- TX_FAR _CeladonDinerText_491a7
- db "@"
-
-ReceivedCoinCaseText:
- TX_FAR _ReceivedCoinCaseText
- TX_SFX_KEY_ITEM
- db "@"
-
-CoinCaseNoRoomText:
- TX_FAR _CoinCaseNoRoomText
- db "@"
-
-CeladonDinerText_491b7:
- TX_FAR _CeladonDinerText_491b7
- db "@"
diff --git a/scripts/CeladonDiner2.asm b/scripts/CeladonDiner2.asm
new file mode 100755
index 00000000..8cd66a19
--- /dev/null
+++ b/scripts/CeladonDiner2.asm
@@ -0,0 +1,38 @@
+Func_f1f31:
+ CheckEvent EVENT_GOT_COIN_CASE
+ jr nz, .asm_eb14d
+ ld hl, CeladonDinerText_491a7
+ call PrintText
+ lb bc, COIN_CASE, 1
+ call GiveItem
+ jr nc, .BagFull
+ SetEvent EVENT_GOT_COIN_CASE
+ ld hl, ReceivedCoinCaseText
+ call PrintText
+ jr .asm_68b61
+.BagFull
+ ld hl, CoinCaseNoRoomText
+ call PrintText
+ jr .asm_68b61
+.asm_eb14d
+ ld hl, CeladonDinerText_491b7
+ call PrintText
+.asm_68b61
+ ret
+
+CeladonDinerText_491a7:
+ TX_FAR _CeladonDinerText_491a7
+ db "@"
+
+ReceivedCoinCaseText:
+ TX_FAR _ReceivedCoinCaseText
+ TX_SFX_KEY_ITEM
+ db "@"
+
+CoinCaseNoRoomText:
+ TX_FAR _CoinCaseNoRoomText
+ db "@"
+
+CeladonDinerText_491b7:
+ TX_FAR _CeladonDinerText_491b7
+ db "@"
diff --git a/scripts/CeladonMansion1F.asm b/scripts/CeladonMansion1F.asm
index 41524983..1d7c37b4 100755
--- 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_486a1:
- call PlayCry
- jp TextScriptEnd
-
CeladonMansion1Text1:
TX_FAR _CeladonMansion1Text1
TX_ASM
ld a, MEOWTH
- jp CeladonMansion1_486a1
+ call PlayCry
+ jp TextScriptEnd
CeladonMansion1Text2:
- TX_FAR _CeladonMansion1Text2
- db "@"
+ TX_ASM
+ callba Func_f1e70
+ ld a, [wPikachuHappiness]
+ cp 251
+ jr c, .asm_485d9
+ ld c, 50
+ call DelayFrames
+ ldpikacry e, PikachuCry23
+ callab PlayPikachuSoundClip
+.asm_485d9
+ jp TextScriptEnd
CeladonMansion1Text3:
TX_FAR _CeladonMansion1Text3
TX_ASM
ld a, CLEFAIRY
- jp CeladonMansion1_486a1
+ call PlayCry
+ jp TextScriptEnd
CeladonMansion1Text4:
TX_FAR _CeladonMansion1Text4
TX_ASM
ld a, NIDORAN_F
- jp CeladonMansion1_486a1
+ call PlayCry
+ jp TextScriptEnd
CeladonMansion1Text5:
TX_FAR _CeladonMansion1Text5
diff --git a/scripts/CeladonMansion1F_2.asm b/scripts/CeladonMansion1F_2.asm
new file mode 100755
index 00000000..cdd56ab8
--- /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
+ callab IsStarterPikachuInOurParty
+ ret nc
+ ld hl, CeladonMansionText_f1e9c
+ call PrintText
+ ld a, $0
+ ld [wDoNotWaitForButtonPressAfterDisplayingText], a
+ call Func_f1ea2
+ call PrintText
+ ret
+
+CeladonMansion1Text_f1e96:
+ TX_FAR _CeladonMansion1Text2
+ TX_WAIT
+ db "@"
+
+CeladonMansionText_f1e9c:
+ TX_FAR _CeladonMansion1Text6
+ TX_BLINK
+ db "@"
+
+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
+ dbbw 0, $ff, CeladonMansion1Text_f1eee
+
+CeladonMansion1Text_f1ed5:
+ TX_FAR _CeladonMansion1Text7
+ db "@"
+
+CeladonMansion1Text_f1eda:
+ TX_FAR _CeladonMansion1Text8
+ db "@"
+
+CeladonMansion1Text_f1edf:
+ TX_FAR _CeladonMansion1Text9
+ db "@"
+
+CeladonMansion1Text_f1ee4:
+ TX_FAR _CeladonMansion1Text10
+ db "@"
+
+CeladonMansion1Text_f1ee9:
+ TX_FAR _CeladonMansion1Text11
+ db "@"
+
+CeladonMansion1Text_f1eee:
+ TX_FAR _CeladonMansion1Text12
+ db "@"
diff --git a/scripts/CeladonMansion3F.asm b/scripts/CeladonMansion3F.asm
index 43832f63..64a8343b 100755
--- 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,31 +20,120 @@ CeladonMansion3F_TextPointers:
dw GameFreakSignText
ProgrammerText:
+ TX_ASM
+ call CeladonMansion3_PokedexCount
+ cp 150
+ ld hl, CeladonMansion3Text_486f5
+ jr nc, .print
+ ld hl, CeladonMansion3Text_486f0
+.print
+ call PrintText
+ jp TextScriptEnd
+
+CeladonMansion3Text_486f0:
TX_FAR _ProgrammerText
db "@"
+CeladonMansion3Text_486f5:
+ TX_FAR _ProgrammerText2
+ db "@"
+
GraphicArtistText:
+ TX_ASM
+ call CeladonMansion3_PokedexCount
+ cp 150
+ 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]
+ callab PrintDiploma
+ ld hl, wd730
+ res 6, [hl]
+ call GBPalWhiteOutWithDelay3
+ call ReloadTilesetTilePatterns
+ call RestoreScreenTilesAndReloadTilePatterns
+ call LoadScreenTilesFromBuffer2
+ call Delay3
+ call GBPalNormal
+ ld hl, CeladonMansion3Text_4876b
+ ld a, [$ffdb]
+ and a
+ jr nz, .print
+ ld hl, CeladonMansion3Text_48766
+ jr .print
+
+.declined_print
+ ld hl, CeladonMansion3Text_48761
+.print
+ call PrintText
+ jp TextScriptEnd
+
+CeladonMansion3Text_48757:
TX_FAR _GraphicArtistText
db "@"
+CeladonMansion3Text_4875c:
+ TX_FAR _GraphicArtistText2
+ db "@"
+
+CeladonMansion3Text_48761:
+ TX_FAR _GraphicArtistText3
+ db "@"
+
+CeladonMansion3Text_48766:
+ TX_FAR _GraphicArtistText4
+ db "@"
+
+CeladonMansion3Text_4876b:
+ TX_FAR _GraphicArtistText5
+ db "@"
+
WriterText:
+ TX_ASM
+ call CeladonMansion3_PokedexCount
+ cp 150
+ ld hl, CeladonMansion3Text_48789
+ jr nc, .print
+ ld hl, CeladonMansion3Text_48784
+.print
+ call PrintText
+ jp TextScriptEnd
+
+CeladonMansion3Text_48784:
TX_FAR _WriterText
db "@"
+CeladonMansion3Text_48789:
+ TX_FAR _WriterText2
+ db "@"
+
DirectorText:
TX_ASM
-
+ call CeladonMansion3_PokedexCount
; check pokédex
- ld hl, wPokedexOwned
- ld b, wPokedexOwnedEnd - wPokedexOwned
- call CountSetBits
- ld a, [wNumSetBits]
cp 150
jr nc, .CompletedDex
ld hl, .GameDesigner
jr .done
.CompletedDex
ld hl, .CompletedDexText
+ call PrintText
+ call Delay3
+ xor a
+ ld [wDoNotWaitForButtonPressAfterDisplayingText], a
+ ld hl, .UnlockedDiplomaPrinting
.done
call PrintText
jp TextScriptEnd
@@ -54,18 +151,26 @@ DirectorText:
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
jp TextScriptEnd
-GameFreakPCText1:
- TX_FAR _CeladonMansion3Text5
+.UnlockedDiplomaPrinting
+ TX_FAR _CompletedDexText2
db "@"
+GameFreakPCText1:
+ TX_ASM
+ callba Func_f1ef3
+ jp TextScriptEnd
+
GameFreakPCText2:
- TX_FAR _CeladonMansion3Text6
- db "@"
+ TX_ASM
+ callba Func_f1eff
+ jp TextScriptEnd
GameFreakPCText3:
- TX_FAR _CeladonMansion3Text7
- db "@"
+ TX_ASM
+ callba Func_f1f0b
+ jp TextScriptEnd
GameFreakSignText:
- TX_FAR _CeladonMansion3Text8
- db "@"
+ TX_ASM
+ callba Func_f1f17
+ jp TextScriptEnd
diff --git a/scripts/CeladonMansion3F_2.asm b/scripts/CeladonMansion3F_2.asm
new file mode 100755
index 00000000..3a7035ba
--- /dev/null
+++ b/scripts/CeladonMansion3F_2.asm
@@ -0,0 +1,35 @@
+Func_f1ef3:
+ ld hl, CeladonMansion3Text_f1efa
+ call PrintText
+ ret
+
+CeladonMansion3Text_f1efa:
+ TX_FAR _CeladonMansion3Text5
+ db "@"
+
+Func_f1eff:
+ ld hl, CeladonMansion3Text_f1f06
+ call PrintText
+ ret
+
+CeladonMansion3Text_f1f06:
+ TX_FAR _CeladonMansion3Text6
+ db "@"
+
+Func_f1f0b:
+ ld hl, CeladonMansion3Text_f1f12
+ call PrintText
+ ret
+
+CeladonMansion3Text_f1f12:
+ TX_FAR _CeladonMansion3Text7
+ db "@"
+
+Func_f1f17:
+ ld hl, CeladonMansion3Text_f1f1e
+ call PrintText
+ ret
+
+CeladonMansion3Text_f1f1e:
+ TX_FAR _CeladonMansion3Text8
+ db "@"
diff --git a/scripts/CeladonMansionRoof.asm b/scripts/CeladonMansionRoof.asm
index d5028537..1813e9ee 100755
--- 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 e519d506..8e485352 100755
--- 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 8afd805a..e84eaae0 100755
--- 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 e7e216d9..c8a108d7 100755
--- a/scripts/CeladonMart3F.asm
+++ b/scripts/CeladonMart3F.asm
@@ -22,42 +22,9 @@ CeladonMart3F_TextPointers:
CeladonMart3Text1:
TX_ASM
- CheckEvent EVENT_GOT_TM18
- jr nz, .asm_a5463
- ld hl, TM18PreReceiveText
- call PrintText
- lb bc, TM_18, 1
- call GiveItem
- jr nc, .BagFull
- SetEvent EVENT_GOT_TM18
- ld hl, ReceivedTM18Text
- jr .asm_81359
-.BagFull
- ld hl, TM18NoRoomText
- jr .asm_81359
-.asm_a5463
- ld hl, TM18ExplanationText
-.asm_81359
- call PrintText
+ callab Func_f1e30
jp TextScriptEnd
-TM18PreReceiveText:
- TX_FAR _TM18PreReceiveText
- db "@"
-
-ReceivedTM18Text:
- TX_FAR _ReceivedTM18Text
- TX_SFX_ITEM_1
- db "@"
-
-TM18ExplanationText:
- TX_FAR _TM18ExplanationText
- db "@"
-
-TM18NoRoomText:
- TX_FAR _TM18NoRoomText
- db "@"
-
CeladonMart3Text2:
TX_FAR _CeladonMart3Text2
db "@"
diff --git a/scripts/CeladonMart3F_2.asm b/scripts/CeladonMart3F_2.asm
new file mode 100755
index 00000000..8c99e0e0
--- /dev/null
+++ b/scripts/CeladonMart3F_2.asm
@@ -0,0 +1,38 @@
+Func_f1e30
+ CheckEvent EVENT_GOT_TM18
+ jr nz, .asm_f1e54
+ ld hl, CeladonMart3Text_f1e5b
+ call PrintText
+ lb bc, TM_18, 1
+ call GiveItem
+ jr nc, .asm_f1e4f
+ SetEvent EVENT_GOT_TM18
+ ld hl, CeladonMart3Text_f1e60
+ jr .asm_f1e57
+
+.asm_f1e4f
+ ld hl, CeladonMart3Text_f1e6b
+ jr .asm_f1e57
+
+.asm_f1e54
+ ld hl, CeladonMart3Text_f1e66
+.asm_f1e57
+ call PrintText
+ ret
+
+CeladonMart3Text_f1e5b:
+ TX_FAR _TM18PreReceiveText
+ db "@"
+
+CeladonMart3Text_f1e60:
+ TX_FAR _ReceivedTM18Text
+ TX_SFX_ITEM_1
+ db "@"
+
+CeladonMart3Text_f1e66:
+ TX_FAR _TM18ExplanationText
+ db "@"
+
+CeladonMart3Text_f1e6b:
+ TX_FAR _TM18NoRoomText
+ db "@"
diff --git a/scripts/CeladonMart5F.asm b/scripts/CeladonMart5F.asm
index 9f52f866..74c590be 100755
--- 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 35c740b2..64871bdd 100755
--- 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
@@ -71,7 +72,7 @@ CeladonMartRoofScript_GiveDrinkToGirl:
ld hl, wd730
res 6, [hl]
call HandleMenuInput
- bit 1, a ; pressed b
+ bit BIT_B_BUTTON, a ; pressed b
ret nz
ld hl, wFilteredBagItems
ld a, [wCurrentMenuItem]
@@ -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:
- jpba RemoveItemByID
+ callba RemoveItemByID
+ ret
CeladonMartRoofText_484ee:
TX_FAR _CeladonMartRoofText_484ee
diff --git a/scripts/CeladonPokecenter.asm b/scripts/CeladonPokecenter.asm
index b5efb7d5..21b9452c 100755
--- a/scripts/CeladonPokecenter.asm
+++ b/scripts/CeladonPokecenter.asm
@@ -7,6 +7,7 @@ CeladonPokecenter_TextPointers:
dw CeladonPokecenterText2
dw CeladonPokecenterText3
dw CeladonTradeNurseText
+ dw CeladonPokecenterText5
CeladonTradeNurseText:
TX_CABLE_CLUB_RECEPTIONIST
@@ -21,3 +22,8 @@ CeladonPokecenterText2:
CeladonPokecenterText3:
TX_FAR _CeladonPokecenterText3
db "@"
+
+CeladonPokecenterText5:
+ TX_ASM
+ callab PokecenterChanseyText
+ jp TextScriptEnd
diff --git a/scripts/CeruleanCave1F.asm b/scripts/CeruleanCave1F.asm
index 6f5c7b13..e2803587 100755
--- 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 100755
--- 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 a570ab18..b98ca4ba 100755
--- a/scripts/CeruleanCaveB1F.asm
+++ b/scripts/CeruleanCaveB1F.asm
@@ -7,7 +7,7 @@ CeruleanCaveB1F_Script:
ld [wCeruleanCaveB1FCurScript], a
ret
-CeruleanCaveB1F_ScriptPointers
+CeruleanCaveB1F_ScriptPointers:
dw CheckFightingMapTrainers
dw DisplayEnemyTrainerTextAndStartBattle
dw EndTrainerBattle
@@ -16,6 +16,8 @@ CeruleanCaveB1F_TextPointers:
dw MewtwoText
dw PickUpItemText
dw PickUpItemText
+ dw PickUpItemText
+ dw PickUpItemText
MewtwoTrainerHeader:
dbEventFlagBit EVENT_BEAT_MEWTWO
diff --git a/scripts/CeruleanCity.asm b/scripts/CeruleanCity.asm
index 117ec4da..c36b3dd6 100755
--- a/scripts/CeruleanCity.asm
+++ b/scripts/CeruleanCity.asm
@@ -64,9 +64,7 @@ CeruleanCityScript0:
ld a, [wWalkBikeSurfState]
and a
jr z, .asm_19512
- ld a, $ff
- ld [wNewSoundID], a
- call PlaySound
+ call StopAllMusic
.asm_19512
ld c, BANK(Music_MeetRival)
ld a, MUSIC_MEET_RIVAL
@@ -136,23 +134,8 @@ CeruleanCityScript1:
call SaveEndBattleTextPointers
ld a, OPP_SONY1
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
ld [hJoyHeld], a
call CeruleanCityScript_1955d
@@ -171,9 +154,7 @@ CeruleanCityScript2:
ld a, $1
ld [hSpriteIndexOrTextID], a
call DisplayTextID
- ld a, $ff
- ld [wNewSoundID], a
- call PlaySound
+ call StopAllMusic
callba Music_RivalAlternateStart
ld a, $1
ld [H_SPRITEINDEX], a
diff --git a/scripts/CeruleanGym.asm b/scripts/CeruleanGym.asm
index c4aaf7de..d1dd66e4 100755
--- a/scripts/CeruleanGym.asm
+++ b/scripts/CeruleanGym.asm
@@ -157,8 +157,6 @@ CeruleanGymText7:
CeruleanGymText_5c7d8:
TX_FAR _CeruleanGymText_5c7d8
- TX_SFX_KEY_ITEM ; actually plays the second channel of SFX_BALL_POOF due to the wrong music bank being loaded
- TX_BLINK
db "@"
CeruleanGymText2:
diff --git a/scripts/CeruleanPokecenter.asm b/scripts/CeruleanPokecenter.asm
index 82bd04f3..de4fd57d 100755
--- a/scripts/CeruleanPokecenter.asm
+++ b/scripts/CeruleanPokecenter.asm
@@ -7,6 +7,7 @@ CeruleanPokecenter_TextPointers:
dw CeruleanPokecenterText2
dw CeruleanPokecenterText3
dw CeruleanTradeNurseText
+ dw CeruleanPokecenterText5
CeruleanTradeNurseText:
TX_CABLE_CLUB_RECEPTIONIST
@@ -21,3 +22,8 @@ CeruleanPokecenterText2:
CeruleanPokecenterText3:
TX_FAR _CeruleanPokecenterText3
db "@"
+
+CeruleanPokecenterText5:
+ TX_ASM
+ callab PokecenterChanseyText
+ jp TextScriptEnd
diff --git a/scripts/CeruleanTradeHouse.asm b/scripts/CeruleanTradeHouse.asm
index f80da19a..8b5d4495 100755
--- a/scripts/CeruleanTradeHouse.asm
+++ b/scripts/CeruleanTradeHouse.asm
@@ -1,17 +1,106 @@
CeruleanTradeHouse_Script:
- jp EnableAutoTextBoxDrawing
+ call EnableAutoTextBoxDrawing
+ ret
CeruleanTradeHouse_TextPointers:
dw CeruleanHouse1Text1
dw CeruleanHouse1Text2
+ dw CeruleanHouse1Text3
+ dw CeruleanHouse1Text4
CeruleanHouse1Text1:
- TX_FAR _CeruleanHouse1Text1
+ TX_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:
+ TX_FAR MelanieText1
+ TX_WAIT
+ db "@"
+
+CeruleanHouse1Text_1cfce:
+ TX_FAR MelanieText2
+ db "@"
+
+CeruleanHouse1Text_1cfd3:
+ TX_FAR MelanieText3
+ TX_WAIT
+ db "@"
+
+CeruleanHouse1Text_1cfd9:
+ TX_FAR MelanieText4
+ TX_WAIT
+ db "@"
+
+CeruleanHouse1Text_1cfdf:
+ TX_FAR MelanieText5
+ TX_WAIT
db "@"
CeruleanHouse1Text2:
+ TX_FAR MelanieBulbasaurText
+ TX_ASM
+ ld a, BULBASAUR
+ call PlayCry
+ jp TextScriptEnd
+
+CeruleanHouse1Text3:
+ TX_FAR MelanieOddishText
+ TX_ASM
+ ld a, ODDISH
+ call PlayCry
+ jp TextScriptEnd
+
+CeruleanHouse1Text4:
+ TX_FAR MelanieSandshrewText
TX_ASM
- ld a, $6
- ld [wWhichTrade], a
- predef DoInGameTradeDialogue
+ ld a, SANDSHREW
+ call PlayCry
jp TextScriptEnd
diff --git a/scripts/ChampionsRoom.asm b/scripts/ChampionsRoom.asm
index e3cdc6d2..b8ce710b 100755
--- 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
@@ -40,9 +41,9 @@ GaryScript1:
ret
GaryEntrance_RLEMovement:
- db D_UP,1
- db D_RIGHT,1
- db D_UP,3
+ db D_UP, 1
+ db D_RIGHT, 1
+ db D_UP, 3
db $ff
GaryScript2:
@@ -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
@@ -217,8 +207,8 @@ GaryScript9:
ret
WalkToHallOfFame_RLEMovment:
- db D_UP,4
- db D_LEFT,1
+ db D_UP, 4
+ db D_LEFT, 1
db $ff
GaryScript10:
diff --git a/scripts/CinnabarGym.asm b/scripts/CinnabarGym.asm
index f8be5823..2dc07e58 100755
--- a/scripts/CinnabarGym.asm
+++ b/scripts/CinnabarGym.asm
@@ -35,11 +35,14 @@ CinnabarGymScript_75792:
ld [wOpponentAfterWrongAnswer], a
ret
-CinnabarGymScript_757a0:
+CinnabarGymScript_74f48:
ld a, [hSpriteIndexOrTextID]
ld [wTrainerHeaderFlagBit], a
ret
+CinnabarGymFlagAction:
+ predef_jump FlagActionPredef
+
CinnabarGym_ScriptPointers:
dw CinnabarGymScript0
dw CinnabarGymScript1
@@ -55,12 +58,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, MovementData_757d7
jr .asm_757cb
.asm_757c3
- ld de, MovementData_757da
ld a, PLAYER_DIR_RIGHT
ld [wPlayerMovingDirection], a
+ ld hl, PikachuMovementData_74f9e
+ ld b, SPRITE_FACING_RIGHT
+ call CinnabarGymScript_74fa3
+ ld de, MovementData_757da
.asm_757cb
call MoveSprite
ld a, $1
@@ -73,10 +82,39 @@ MovementData_757d7:
db NPC_MOVEMENT_UP
db $FF
+PikachuMovementData_74f97:
+ db $00
+ db $20
+ db $1e
+ db $35
+ db $3f
+
MovementData_757da:
db NPC_MOVEMENT_LEFT
db $FF
+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
+ callab GetPikachuFacingDirectionAndReturnToE
+ pop bc
+ pop hl
+ ld a, b
+ cp e
+ ret nz
+ call ApplyPikachuMovementData
+ ret
+
CinnabarGymScript1:
ld a, [wd730]
bit 0, a
@@ -88,52 +126,74 @@ CinnabarGymScript1:
ld [hSpriteIndexOrTextID], a
jp DisplayTextID
-CinnabarGymFlagAction:
- predef_jump FlagActionPredef
-
CinnabarGymScript2:
+ call CinnabarGymScript_753e9
ld a, [wIsInBattle]
cp $ff
jp z, CinnabarGymScript_75792
ld a, [wTrainerHeaderFlagBit]
- ld [$ffdb], 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]
ld [$ffdb], 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
+ ld [$ffdb], 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
CinnabarGymScript3:
+ call CinnabarGymScript_753e9
ld a, [wIsInBattle]
cp $ff
jp z, CinnabarGymScript_75792
@@ -184,7 +244,7 @@ CinnabarGym_TextPointers:
dw ReceivedTM38Text
dw TM38NoRoomText
-CinnabarGymScript_758b7:
+CinnabarGymScript_750c3:
ld a, [hSpriteIndexOrTextID]
ld [wSpriteIndex], a
call EngageMapTrainer
@@ -225,7 +285,7 @@ CinnabarGymText1:
call SaveEndBattleTextPointers
ld a, $7
ld [wGymLeaderNo], a
- jp CinnabarGymScript_758b7
+ jp CinnabarGymScript_750c3
BlaineBattleText:
TX_FAR _BlaineBattleText
@@ -257,7 +317,7 @@ TM38NoRoomText:
CinnabarGymText2:
TX_ASM
- call CinnabarGymScript_757a0
+ call CinnabarGymScript_74f48
CheckEvent EVENT_BEAT_CINNABAR_GYM_TRAINER_0
jr nz, .asm_46bb4
ld hl, CinnabarGymText_7595f
@@ -265,7 +325,7 @@ CinnabarGymText2:
ld hl, CinnabarGymText_75964
ld de, CinnabarGymText_75964
call SaveEndBattleTextPointers
- jp CinnabarGymScript_758b7
+ jp CinnabarGymScript_750c3
.asm_46bb4
ld hl, CinnabarGymText_75969
call PrintText
@@ -285,16 +345,25 @@ CinnabarGymText_75969:
CinnabarGymText3:
TX_ASM
- call CinnabarGymScript_757a0
+ call CinnabarGymScript_74f48
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, CinnabarGymText_75994
call PrintText
ld hl, CinnabarGymText_75999
ld de, CinnabarGymText_75999
call SaveEndBattleTextPointers
- jp CinnabarGymScript_758b7
-.asm_4b406
+ jp CinnabarGymScript_750c3
+
+.asm_751a8
ld hl, CinnabarGymText_7599e
call PrintText
jp TextScriptEnd
@@ -313,16 +382,24 @@ CinnabarGymText_7599e:
CinnabarGymText4:
TX_ASM
- call CinnabarGymScript_757a0
+ call CinnabarGymScript_74f48
CheckEvent EVENT_BEAT_CINNABAR_GYM_TRAINER_2
- jr nz, .asm_c0673
+ jr nz, .asm_751ee
+ 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, CinnabarGymText_759c9
call PrintText
ld hl, CinnabarGymText_759ce
ld de, CinnabarGymText_759ce
call SaveEndBattleTextPointers
- jp CinnabarGymScript_758b7
-.asm_c0673
+ jp CinnabarGymScript_750c3
+.asm_751ee
ld hl, CinnabarGymText_759d3
call PrintText
jp TextScriptEnd
@@ -341,16 +418,24 @@ CinnabarGymText_759d3:
CinnabarGymText5:
TX_ASM
- call CinnabarGymScript_757a0
+ call CinnabarGymScript_74f48
CheckEvent EVENT_BEAT_CINNABAR_GYM_TRAINER_3
- jr nz, .asm_5cfd7
+ jr nz, .asm_75234
+ 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, CinnabarGymText_759fe
call PrintText
ld hl, CinnabarGymText_75a03
ld de, CinnabarGymText_75a03
call SaveEndBattleTextPointers
- jp CinnabarGymScript_758b7
-.asm_5cfd7
+ jp CinnabarGymScript_750c3
+.asm_75234
ld hl, CinnabarGymText_75a08
call PrintText
jp TextScriptEnd
@@ -369,15 +454,23 @@ CinnabarGymText_75a08:
CinnabarGymText6:
TX_ASM
- call CinnabarGymScript_757a0
+ call CinnabarGymScript_74f48
CheckEvent EVENT_BEAT_CINNABAR_GYM_TRAINER_4
jr nz, .asm_776b4
+ 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, CinnabarGymText_75a33
call PrintText
ld hl, CinnabarGymText_75a38
ld de, CinnabarGymText_75a38
call SaveEndBattleTextPointers
- jp CinnabarGymScript_758b7
+ jp CinnabarGymScript_750c3
.asm_776b4
ld hl, CinnabarGymText_75a3d
call PrintText
@@ -397,15 +490,23 @@ CinnabarGymText_75a3d:
CinnabarGymText7:
TX_ASM
- call CinnabarGymScript_757a0
+ call CinnabarGymScript_74f48
CheckEvent EVENT_BEAT_CINNABAR_GYM_TRAINER_5
jr nz, .asm_2f755
+ 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, CinnabarGymText_75a68
call PrintText
ld hl, CinnabarGymText_75a6d
ld de, CinnabarGymText_75a6d
call SaveEndBattleTextPointers
- jp CinnabarGymScript_758b7
+ jp CinnabarGymScript_750c3
.asm_2f755
ld hl, CinnabarGymText_75a72
call PrintText
@@ -425,15 +526,23 @@ CinnabarGymText_75a72:
CinnabarGymText8:
TX_ASM
- call CinnabarGymScript_757a0
+ call CinnabarGymScript_74f48
CheckEvent EVENT_BEAT_CINNABAR_GYM_TRAINER_6
jr nz, .asm_d87be
+ 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, CinnabarGymText_75a9d
call PrintText
ld hl, CinnabarGymText_75aa2
ld de, CinnabarGymText_75aa2
call SaveEndBattleTextPointers
- jp CinnabarGymScript_758b7
+ jp CinnabarGymScript_750c3
.asm_d87be
ld hl, CinnabarGymText_75aa7
call PrintText
@@ -453,20 +562,5 @@ CinnabarGymText_75aa7:
CinnabarGymText9:
TX_ASM
- CheckEvent EVENT_BEAT_BLAINE
- jr nz, .asm_627d9
- ld hl, CinnabarGymText_75ac2
- jr .asm_0b11d
-.asm_627d9
- ld hl, CinnabarGymText_75ac7
-.asm_0b11d
- call PrintText
+ callab Func_f2133
jp TextScriptEnd
-
-CinnabarGymText_75ac2:
- TX_FAR _CinnabarGymText_75ac2
- db "@"
-
-CinnabarGymText_75ac7:
- TX_FAR _CinnabarGymText_75ac7
- db "@"
diff --git a/scripts/CinnabarGym3.asm b/scripts/CinnabarGym3.asm
new file mode 100755
index 00000000..9e8cad74
--- /dev/null
+++ b/scripts/CinnabarGym3.asm
@@ -0,0 +1,64 @@
+Func_f2133:
+ CheckEvent EVENT_BEAT_BLAINE
+ jr nz, .asm_627d9
+ ld hl, CinnabarGymText_75ac2
+ jr .asm_0b11d
+.asm_627d9
+ ld hl, CinnabarGymText_75ac7
+.asm_0b11d
+ call PrintText
+ ret
+
+CinnabarGymText_75ac2:
+ TX_FAR _CinnabarGymText_75ac2
+ db "@"
+
+CinnabarGymText_75ac7:
+ TX_FAR _CinnabarGymText_75ac7
+ db "@"
+
+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:
+ TX_FAR _CinnabarGymText_1
+ db "@"
+
+CinnabarGymText_f216e:
+ TX_FAR _CinnabarGymText_2
+ db "@"
+
+CinnabarGymText_f2173:
+ TX_FAR _CinnabarGymText_3
+ db "@"
+
+CinnabarGymText_f2178:
+ TX_FAR _CinnabarGymText_4
+ db "@"
+
+CinnabarGymText_f217d:
+ TX_FAR _CinnabarGymText_5
+ db "@"
+
+CinnabarGymText_f2182:
+ TX_FAR _CinnabarGymText_6
+ db "@"
+
+CinnabarGymText_f2187:
+ TX_FAR _CinnabarGymText_7 ; unused
+ db "@"
diff --git a/scripts/CinnabarGym_2.asm b/scripts/CinnabarGym_2.asm
new file mode 100755
index 00000000..00118fb5
--- /dev/null
+++ b/scripts/CinnabarGym_2.asm
@@ -0,0 +1,18 @@
+CinnabarGymScript_753de:
+ callab 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/CinnabarIsland.asm b/scripts/CinnabarIsland.asm
index b6346a9c..5716428c 100755
--- a/scripts/CinnabarIsland.asm
+++ b/scripts/CinnabarIsland.asm
@@ -35,7 +35,7 @@ CinnabarIslandScript0:
ld [wSimulatedJoypadStatesEnd], a
call StartSimulatingJoypadStates
xor a
- ld [wSpriteStateData1 + 9], a
+ ld [wSpritePlayerStateData1FacingDirection], a
ld [wJoyIgnore], a
ld a, $1
ld [wCinnabarIslandCurScript], a
diff --git a/scripts/CinnabarPokecenter.asm b/scripts/CinnabarPokecenter.asm
index a6184bb0..53301266 100755
--- a/scripts/CinnabarPokecenter.asm
+++ b/scripts/CinnabarPokecenter.asm
@@ -7,6 +7,7 @@ CinnabarPokecenter_TextPointers:
dw CinnabarPokecenterText2
dw CinnabarPokecenterText3
dw CinnabarTradeNurseText
+ dw CinnabarPokecenterText5
CinnabarHealNurseText:
TX_POKECENTER_NURSE
@@ -21,3 +22,8 @@ CinnabarPokecenterText3:
CinnabarTradeNurseText:
TX_CABLE_CLUB_RECEPTIONIST
+
+CinnabarPokecenterText5:
+ TX_ASM
+ callab PokecenterChanseyText
+ jp TextScriptEnd
diff --git a/scripts/Colosseum.asm b/scripts/Colosseum.asm
index 8cc6b056..8cc6b056 100755..100644
--- a/scripts/Colosseum.asm
+++ b/scripts/Colosseum.asm
diff --git a/scripts/CopycatsHouse2F.asm b/scripts/CopycatsHouse2F.asm
index b43234c3..e0ec5425 100755
--- a/scripts/CopycatsHouse2F.asm
+++ b/scripts/CopycatsHouse2F.asm
@@ -84,7 +84,7 @@ CopycatsHouse2FText6:
CopycatsHouse2FText7:
TX_ASM
- ld a, [wSpriteStateData1 + 9]
+ ld a, [wSpritePlayerStateData1FacingDirection]
cp SPRITE_FACING_UP
ld hl, CopycatsHouse2FText_5cd1c
jr nz, .notUp
diff --git a/scripts/Daycare.asm b/scripts/Daycare.asm
index 81cf5534..5b65307e 100755
--- a/scripts/Daycare.asm
+++ b/scripts/Daycare.asm
@@ -50,11 +50,21 @@ DayCareMText1:
ld a, PARTY_TO_DAYCARE
ld [wMoveMonType], a
call MoveMon
+ callab 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
+ callab 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
+ callab 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
+ callab PlayPikachuSoundClip
+.asm_56430
ld hl, DayCareGotMonBackText
jr .done
diff --git a/scripts/FuchsiaMart.asm b/scripts/FuchsiaMart.asm
index f17cac49..50786127 100755
--- 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 182ec8c3..40aa3d45 100755
--- a/scripts/FuchsiaPokecenter.asm
+++ b/scripts/FuchsiaPokecenter.asm
@@ -7,6 +7,7 @@ FuchsiaPokecenter_TextPointers:
dw FuchsiaPokecenterText2
dw FuchsiaPokecenterText3
dw FuchsiaTradeNurseText
+ dw FuchsiaPokecenterText5
FuchsiaHealNurseText:
TX_POKECENTER_NURSE
@@ -21,3 +22,8 @@ FuchsiaPokecenterText3:
FuchsiaTradeNurseText:
TX_CABLE_CLUB_RECEPTIONIST
+
+FuchsiaPokecenterText5:
+ TX_ASM
+ callab PokecenterChanseyText
+ jp TextScriptEnd
diff --git a/scripts/GameCorner.asm b/scripts/GameCorner.asm
index 265508e0..e2b7690c 100755
--- 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
+ callab Func_f1f23
+ ld de, MovementData_48c5a
.asm_48c4d
ld a, $b
ld [H_SPRITEINDEX], 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]
coord hl, 11, 0
- ld b, $5
- ld c, $7
+ lb bc, 5, 7
call TextBoxBorder
call UpdateSprites
coord hl, 12, 1
- ld b, 4
- ld c, 7
+ lb bc, 4, 7
call ClearScreenArea
coord hl, 12, 2
ld de, GameCornerMoneyText
@@ -491,7 +493,7 @@ CeladonGameCornerScript_48f1e:
call PlaceString
coord hl, 12, 3
ld de, wPlayerMoney
- ld c, $a3
+ ld c, 3 | MONEY_SIGN | LEADING_ZEROES
call PrintBCDNumber
coord hl, 12, 4
ld de, GameCornerCoinText
diff --git a/scripts/GameCorner2.asm b/scripts/GameCorner2.asm
new file mode 100755
index 00000000..f8d25905
--- /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 f83c0ba4..d618d155 100755
--- a/scripts/IndigoPlateauLobby.asm
+++ b/scripts/IndigoPlateauLobby.asm
@@ -20,6 +20,7 @@ IndigoPlateauLobby_TextPointers:
dw IndigoPlateauLobbyText3
dw IndigoCashierText
dw IndigoTradeNurseText
+ dw IndigoPlateauLobbyText6
IndigoHealNurseText:
TX_POKECENTER_NURSE
@@ -34,3 +35,8 @@ IndigoPlateauLobbyText3:
IndigoTradeNurseText:
TX_CABLE_CLUB_RECEPTIONIST
+
+IndigoPlateauLobbyText6:
+ TX_ASM
+ callab PokecenterChanseyText
+ jp TextScriptEnd
diff --git a/scripts/LancesRoom.asm b/scripts/LancesRoom.asm
index 5e19ea7d..aec555a3 100755
--- a/scripts/LancesRoom.asm
+++ b/scripts/LancesRoom.asm
@@ -18,23 +18,22 @@ LanceShowOrHideEntranceBlocks:
; open entrance
ld a, $31
ld b, $32
- jp LanceSetEntranceBlocks
+ jp .LanceSetEntranceBlocks
+
.closeEntrance
ld a, $72
ld b, $73
-
-LanceSetEntranceBlocks:
+.LanceSetEntranceBlocks
; Replaces the tile blocks so the player can't leave.
push bc
ld [wNewTileBlockID], a
lb bc, 6, 2
- call LanceSetEntranceBlock
+ call .LanceSetEntranceBlock
pop bc
ld a, b
ld [wNewTileBlockID], a
lb bc, 6, 3
-
-LanceSetEntranceBlock:
+.LanceSetEntranceBlock
predef_jump ReplaceTileBlock
ResetLanceScript:
@@ -110,7 +109,7 @@ WalkToLance:
ret
WalkToLance_RLEList:
- db D_UP, $0C
+ db D_UP, $0D
db D_LEFT, $0C
db D_DOWN, $07
db D_LEFT, $06
diff --git a/scripts/LavenderPokecenter.asm b/scripts/LavenderPokecenter.asm
index 10482fef..21270313 100755
--- a/scripts/LavenderPokecenter.asm
+++ b/scripts/LavenderPokecenter.asm
@@ -7,6 +7,7 @@ LavenderPokecenter_TextPointers:
dw LavenderPokecenterText2
dw LavenderPokecenterText3
dw LavenderTradeNurseText
+ dw LavenderPokecenterText5
LavenderTradeNurseText:
TX_CABLE_CLUB_RECEPTIONIST
@@ -21,3 +22,8 @@ LavenderPokecenterText2:
LavenderPokecenterText3:
TX_FAR _LavenderPokecenterText3
db "@"
+
+LavenderPokecenterText5:
+ TX_ASM
+ callab PokecenterChanseyText
+ jp TextScriptEnd
diff --git a/scripts/MtMoon1F.asm b/scripts/MtMoon1F.asm
index b05b3f60..cb120420 100755
--- a/scripts/MtMoon1F.asm
+++ b/scripts/MtMoon1F.asm
@@ -96,42 +96,37 @@ MtMoon1TrainerHeader6:
MtMoon1Text1:
TX_ASM
ld hl, MtMoon1TrainerHeader0
- call TalkToTrainer
- jp TextScriptEnd
+ jr MtMoon1TalkToTrainer
MtMoon1Text2:
TX_ASM
ld hl, MtMoon1TrainerHeader1
- call TalkToTrainer
- jp TextScriptEnd
+ jr MtMoon1TalkToTrainer
MtMoon1Text3:
TX_ASM
ld hl, MtMoon1TrainerHeader2
- call TalkToTrainer
- jp TextScriptEnd
+ jr MtMoon1TalkToTrainer
MtMoon1Text4:
TX_ASM
ld hl, MtMoon1TrainerHeader3
- call TalkToTrainer
- jp TextScriptEnd
+ jr MtMoon1TalkToTrainer
MtMoon1Text5:
TX_ASM
ld hl, MtMoon1TrainerHeader4
- call TalkToTrainer
- jp TextScriptEnd
+ jr MtMoon1TalkToTrainer
MtMoon1Text6:
TX_ASM
ld hl, MtMoon1TrainerHeader5
- call TalkToTrainer
- jp TextScriptEnd
+ jr MtMoon1TalkToTrainer
MtMoon1Text7:
TX_ASM
ld hl, MtMoon1TrainerHeader6
+MtMoon1TalkToTrainer:
call TalkToTrainer
jp TextScriptEnd
diff --git a/scripts/MtMoonB2F.asm b/scripts/MtMoonB2F.asm
index 863d9d22..cf4583d3 100755
--- a/scripts/MtMoonB2F.asm
+++ b/scripts/MtMoonB2F.asm
@@ -37,13 +37,23 @@ CoordsData_49d37:
db $08,$0E
db $FF
-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,41 @@ 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:
+ 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 $d
- jp nz, MtMoon3Script_49d91
+ jp nz, .asm_49d4b
xor a
ld [hJoyHeld], a
ld a, $1
ld [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,57 +103,93 @@ 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
ld [H_SPRITEINDEX], 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_49db0
+ ld hl, CoordsData_49dd5
call ArePlayerCoordsInArray
- jr c, .asm_49dd7
- ld hl, CoordsData_49df1
+ jr c, .asm_49d9b
+ ld hl, CoordsData_49dce
call ArePlayerCoordsInArray
- jp nc, CheckFightingMapTrainers
- ld de, MovementData_49df9
- jr .asm_49dda
-.asm_49dd7
- ld de, MovementData_49df8
-.asm_49dda
+ 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
ld [H_SPRITEINDEX], a
call MoveSprite
ld a, $5
- ld [wMtMoonB2FCurScript], a
- ld [wCurMapScript], a
+ call MtMoon3Script_49ce5
ret
-CoordsData_49dea:
+CoordsData_49dc0:
db $07,$0C
db $06,$0B
db $05,$0C
db $FF
-CoordsData_49df1:
+CoordsData_49dc7:
+ db $07,$0C
+ db $FF
+
+PikachuMovementData_49dca:
+ db $00
+ db $35
+ db $33
+ db $3f
+
+CoordsData_49dce:
db $07,$0D
db $06,$0E
db $05,$0E
db $FF
-MovementData_49df8:
- db NPC_MOVEMENT_RIGHT
+CoordsData_49dd5:
+ db $07,$0D
+ db $FF
-MovementData_49df9:
- db NPC_MOVEMENT_UP,$FF
+PikachuMovementData_49dd8:
+ db $00
+ db $35
+ db $34
+ db $3f
+
+MovementData_49ddc:
+ db NPC_MOVEMENT_RIGHT
+MovementData_49ddd:
+ db NPC_MOVEMENT_UP
+ db $FF
MtMoon3Script5:
ld a, [wd730]
@@ -135,23 +199,213 @@ MtMoon3Script5:
ld [wJoyIgnore], a
ld a, $1
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
- ld a, $a
+ ld a, $b
ld [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
+ ld [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
+ ld [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
+ ld [H_SPRITEINDEX], 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 [wSpriteStateData1 + 2 * $10 + 1], a
+ ld a, SPRITE_FACING_DOWN
+ ld [wSpriteStateData1 + 2 * $10 + 9], a
+MtMoon3Script9:
+ ld a, $6
+ ld [H_SPRITEINDEX], 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 [wSpriteStateData1 + 6 * $10 + 1], a
+ ld a, SPRITE_FACING_LEFT
+ ld [wSpriteStateData1 + 6 * $10 + 9], a
+ call Delay3
+ ld a, $FF ^ (A_BUTTON | B_BUTTON)
+ ld [wJoyIgnore], a
+ ld a, $d
+ ld [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
+ ld [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 [wSpriteStateData1 + 2 * $10 + 1], a
+ ld [wSpriteStateData1 + 6 * $10 + 1], a
+ xor a
+ ld [wSpriteStateData1 + 2 * $10 + 9], a
+ ld [wSpriteStateData1 + 6 * $10 + 9], a
+ ld a, $FF ^ (A_BUTTON | B_BUTTON)
+ ld [wJoyIgnore], a
+ ld a, $1
+ ld [wDoNotWaitForButtonPressAfterDisplayingText], a
+ ld a, $e
+ ld [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
+ ld [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,213 +416,225 @@ 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
MtMoon3TrainerHeader0:
- dbEventFlagBit EVENT_BEAT_MT_MOON_3_TRAINER_0
- db ($4 << 4) ; trainer's view range
- dwEventFlagAddress EVENT_BEAT_MT_MOON_3_TRAINER_0
- dw MtMoon3BattleText2 ; TextBeforeBattle
- dw MtMoon3AfterBattleText2 ; TextAfterBattle
- dw MtMoon3EndBattleText2 ; TextEndBattle
- dw MtMoon3EndBattleText2 ; TextEndBattle
-
-MtMoon3TrainerHeader1:
dbEventFlagBit EVENT_BEAT_MT_MOON_3_TRAINER_1
- db ($4 << 4) ; trainer's view range
+ db ($4 << 4)
dwEventFlagAddress EVENT_BEAT_MT_MOON_3_TRAINER_1
- dw MtMoon3BattleText3 ; TextBeforeBattle
- dw MtMoon3AfterBattleText3 ; TextAfterBattle
- dw MtMoon3EndBattleText3 ; TextEndBattle
- dw MtMoon3EndBattleText3 ; TextEndBattle
+ dw MtMoon3BattleText3
+ dw MtMoon3AfterBattleText3
+ dw MtMoon3EndBattleText3
+ dw MtMoon3EndBattleText3
-MtMoon3TrainerHeader2:
+MtMoon3TrainerHeader1:
dbEventFlagBit EVENT_BEAT_MT_MOON_3_TRAINER_2
- db ($4 << 4) ; trainer's view range
+ db ($4 << 4)
dwEventFlagAddress EVENT_BEAT_MT_MOON_3_TRAINER_2
- dw MtMoon3BattleText4 ; TextBeforeBattle
- dw MtMoon3AfterBattleText4 ; TextAfterBattle
- dw MtMoon3EndBattleText4 ; TextEndBattle
- dw MtMoon3EndBattleText4 ; TextEndBattle
+ dw MtMoon3BattleText4
+ dw MtMoon3AfterBattleText4
+ dw MtMoon3EndBattleText4
+ dw MtMoon3EndBattleText4
-MtMoon3TrainerHeader3:
+MtMoon3TrainerHeader2:
dbEventFlagBit EVENT_BEAT_MT_MOON_3_TRAINER_3
- db ($4 << 4) ; trainer's view range
+ db ($4 << 4)
dwEventFlagAddress EVENT_BEAT_MT_MOON_3_TRAINER_3
- dw MtMoon3BattleText5 ; TextBeforeBattle
- dw MtMoon3AfterBattleText5 ; TextAfterBattle
- dw MtMoon3EndBattleText5 ; TextEndBattle
- dw MtMoon3EndBattleText5 ; TextEndBattle
+ dw MtMoon3BattleText5
+ dw MtMoon3AfterBattleText5
+ dw MtMoon3EndBattleText5
+ dw MtMoon3EndBattleText5
+
+ db $FF
+
+MtMoon3Text2:
+MtMoon3Text6:
+ db "@"
+
+MtMoon3Text12:
+ TX_FAR _MtMoonJessieJamesText1
+ TX_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
- db $ff
+MtMoon3Text13:
+ TX_FAR _MtMoonJessieJamesText2
+ db "@"
+
+MtMoon3JessieJamesEndBattleText:
+ TX_FAR _MtMoonJessieJamesText3
+ db "@"
+
+MtMoon3Text14:
+ TX_FAR _MtMoonJessieJamesText4
+ TX_ASM
+ ld c, 64
+ call DelayFrames
+ jp TextScriptEnd
MtMoon3Text1:
TX_ASM
CheckEvent EVENT_BEAT_MT_MOON_EXIT_SUPER_NERD
- jr z, .asm_49e8d
- and $c0
- jr nz, .asm_49eb8
- ld hl, MtMoon3Text_49f8f
+ 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_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
ld a, [H_SPRITEINDEX]
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:
TX_ASM
ld hl, MtMoon3TrainerHeader0
- call TalkToTrainer
- jp TextScriptEnd
+ jr MtMoon3TalkToTrainer
-MtMoon3Text3:
+MtMoon3Text4:
TX_ASM
ld hl, MtMoon3TrainerHeader1
- call TalkToTrainer
- jp TextScriptEnd
+ jr MtMoon3TalkToTrainer
-MtMoon3Text4:
- TX_ASM
- ld hl, MtMoon3TrainerHeader2
- call TalkToTrainer
- jp TextScriptEnd
MtMoon3Text5:
TX_ASM
- ld hl, MtMoon3TrainerHeader3
+ ld hl, MtMoon3TrainerHeader2
+MtMoon3TalkToTrainer:
call TalkToTrainer
jp TextScriptEnd
-MtMoon3Text6:
+MtMoon3Text7:
TX_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:
TX_FAR _MtMoon3Text_49f24
db "@"
-MtMoon3Text7:
+MtMoon3Text8:
TX_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:
TX_FAR _MtMoon3Text_49f64
db "@"
-MtMoon3Script_49f69:
- ld hl, MtMoon3Text_49f6f
+MtMoon3Script_4a0f0:
+ ld hl, MtMoon3Text_4a0f6
jp PrintText
-MtMoon3Text_49f6f:
+MtMoon3Text_4a0f6:
TX_FAR _MtMoon3Text_49f6f
TX_SFX_KEY_ITEM
TX_WAIT
db "@"
-MtMoon3Script_49f76:
- ld hl, MtMoon3Text_49f7f
+MtMoon3Script_4a0fd:
+ ld hl, MtMoon3Text_4a106
call PrintText
jp TextScriptEnd
-MtMoon3Text_49f7f:
+MtMoon3Text_4a106:
TX_FAR _MtMoon3Text_49f7f
TX_WAIT
db "@"
-MtMoon3Text_49f85:
+MtMoon3Text_4a10c:
TX_FAR _MtMoon3Text_49f85
db "@"
-MtMoon3Text_49f8a:
+MtMoon3SuperNerdEndBattleText:
TX_FAR _MtMoon3Text_49f8a
db "@"
-MtMoon3Text_49f8f:
+MtMoon3Text_4a116:
TX_FAR _MtMoon3Text_49f8f
db "@"
-MtMoon3Text_49f94:
+MtMoon3Text_4a11b:
TX_FAR _MtMoon3Text_49f94
db "@"
-MtMoon3Text_49f99:
+MtMoon3Text11:
TX_FAR _MtMoon3Text_49f99
TX_SFX_KEY_ITEM
db "@"
-MtMoon3BattleText2:
- TX_FAR _MtMoon3BattleText2
- db "@"
-
-MtMoon3EndBattleText2:
- TX_FAR _MtMoon3EndBattleText2
- db "@"
-
-MtMoon3AfterBattleText2:
- TX_FAR _MtMoon3AfterBattleText2
- db "@"
-
MtMoon3BattleText3:
TX_FAR _MtMoon3BattleText3
db "@"
@@ -404,3 +670,4 @@ MtMoon3EndBattleText5:
MtMoon3AfterBattleText5:
TX_FAR _MtMoon3AfterBattleText5
db "@"
+
diff --git a/scripts/MtMoonB2F_2.asm b/scripts/MtMoonB2F_2.asm
new file mode 100755
index 00000000..c6ec92b4
--- /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
+ callab 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
+ callab LoadPikachuShadowIntoVRAM
+ pop af
+ ld [wUpdateSpritesEnabled], a
+ pop hl
+ call ApplyPikachuMovementData
+ ret
diff --git a/scripts/MtMoonPokecenter.asm b/scripts/MtMoonPokecenter.asm
index 969031db..77386109 100755
--- a/scripts/MtMoonPokecenter.asm
+++ b/scripts/MtMoonPokecenter.asm
@@ -9,9 +9,10 @@ MtMoonPokecenter_TextPointers:
dw MagikarpSalesmanText
dw MtMoonPokecenterText5
dw MtMoonTradeNurseText
+ dw MtMoonPokecenterText7
MtMoonHealNurseText:
- db $ff
+ TX_POKECENTER_NURSE
MtMoonPokecenterText2:
TX_FAR _MtMoonPokecenterText1
@@ -23,72 +24,17 @@ MtMoonPokecenterText3:
MagikarpSalesmanText:
TX_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
- ld [hMoney], a
- ld [hMoney + 2], a
- ld a, $5
- ld [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
+ callab MagikarpSalesman
jp TextScriptEnd
-.Text1
- TX_FAR _MagikarpSalesmanText1
- db "@"
-
-.RefuseText
- TX_FAR _MagikarpSalesmanNoText
- db "@"
-
-.NoMoneyText
- TX_FAR _MagikarpSalesmanNoMoneyText
- db "@"
-
-.Text2
- TX_FAR _MagikarpSalesmanText2
- db "@"
-
MtMoonPokecenterText5:
TX_FAR _MtMoonPokecenterText5
db "@"
MtMoonTradeNurseText:
- db $f6
+ TX_CABLE_CLUB_RECEPTIONIST
+
+MtMoonPokecenterText7:
+ TX_ASM
+ callab PokecenterChanseyText
+ jp TextScriptEnd
diff --git a/scripts/MtMoonPokecenter2.asm b/scripts/MtMoonPokecenter2.asm
new file mode 100755
index 00000000..6097342b
--- /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
+ ld [hMoney], a
+ ld [hMoney + 2], a
+ ld a, $5
+ ld [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
+ TX_FAR _MagikarpSalesmanText1
+ db "@"
+
+.RefuseText
+ TX_FAR _MagikarpSalesmanNoText
+ db "@"
+
+.NoMoneyText
+ TX_FAR _MagikarpSalesmanNoMoneyText
+ db "@"
+
+.Text2
+ TX_FAR _MagikarpSalesmanText2
+ db "@"
diff --git a/scripts/Museum1F.asm b/scripts/Museum1F.asm
index 712f1fc4..fdae9293 100755
--- 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:
TX_ASM
- ld a, [wYCoord]
- cp $4
- jr nz, .asm_8774b
- ld a, [wXCoord]
- cp $d
- jp z, Museum1FScript_5c1f9
- jr .asm_b8709
-.asm_8774b
- cp $3
- jr nz, .asm_d49e7
- ld a, [wXCoord]
- cp $c
- 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
- ld [hJoyHeld], a
- ld hl, Museum1FText_5c21f
- call PrintText
- call YesNoChoice
- ld a, [wCurrentMenuItem]
- and a
- jr nz, .asm_de133
- xor a
- ld [hMoney], a
- ld [hMoney + 1], a
- ld a, $50
- ld [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:
+ callba Func_f1c1b
jp TextScriptEnd
-Museum1FText_5c21a:
- TX_FAR _Museum1FText_5c21a
- db "@"
-
-Museum1FText_5c21f:
- TX_FAR _Museum1FText_5c21f
- db "@"
-
-Museum1FText_5c224:
- TX_FAR _Museum1FText_5c224
- db "@"
-
-Museum1FText_5c229:
- TX_FAR _Museum1FText_5c229
- db "@"
-
-Museum1FText_5c22e:
- TX_FAR _Museum1FText_5c22e
- db "@"
-
-Museum1FText_5c233:
- TX_FAR _Museum1FText_5c233
- db "@"
-
-Museum1FText_5c238:
- TX_FAR _Museum1FText_5c238
- db "@"
-
-Museum1FText_5c23d:
- TX_FAR _Museum1FText_5c23d
- db "@"
-
-Museum1FText_5c242:
- TX_FAR _Museum1FText_5c242
- db "@"
-
Museum1FText2:
TX_ASM
- ld hl, Museum1FText_5c251
- call PrintText
+ callba Func_f1d2a
jp TextScriptEnd
-Museum1FText_5c251:
- TX_FAR _Museum1FText_5c251
- db "@"
-
Museum1FText3:
TX_ASM
- CheckEvent EVENT_GOT_OLD_AMBER
- jr nz, .asm_5c285
- ld hl, Museum1FText_5c28e
- call PrintText
- lb bc, OLD_AMBER, 1
- call GiveItem
- jr nc, .BagFull
- SetEvent EVENT_GOT_OLD_AMBER
- ld a, HS_OLD_AMBER
- ld [wMissableObjectIndex], a
- predef HideObject
- ld hl, ReceivedOldAmberText
- jr .asm_5c288
-.BagFull
- ld hl, Museum1FText_5c29e
- jr .asm_5c288
-.asm_5c285
- ld hl, Museum1FText_5c299
-.asm_5c288
- call PrintText
+ callba Func_f1d36
jp TextScriptEnd
-Museum1FText_5c28e:
- TX_FAR _Museum1FText_5c28e
- db "@"
-
-ReceivedOldAmberText:
- TX_FAR _ReceivedOldAmberText
- TX_SFX_ITEM_1
- db "@"
-
-Museum1FText_5c299:
- TX_FAR _Museum1FText_5c299
- db "@"
-
-Museum1FText_5c29e:
- TX_FAR _Museum1FText_5c29e
- db "@"
-
Museum1FText4:
TX_ASM
- ld hl, Museum1FText_5c2ad
- call PrintText
+ callba Func_f1d80
jp TextScriptEnd
-Museum1FText_5c2ad:
- TX_FAR _Museum1FText_5c2ad
- db "@"
-
Museum1FText5:
TX_ASM
- ld hl, Museum1FText_5c2bc
- call PrintText
+ callba Func_f1d8c
jp TextScriptEnd
-
-Museum1FText_5c2bc:
- TX_FAR _Museum1FText_5c2bc
- db "@"
diff --git a/scripts/Museum1F2.asm b/scripts/Museum1F2.asm
new file mode 100755
index 00000000..9b3df420
--- /dev/null
+++ b/scripts/Museum1F2.asm
@@ -0,0 +1,211 @@
+Func_f1c1b:
+ ld a, [wYCoord]
+ cp $4
+ jr nz, .asm_f1c2c
+ ld a, [wXCoord]
+ cp $d
+ jp z, .asm_f1cde
+ jr .asm_f1c48
+
+.asm_f1c2c
+ cp $3
+ jr nz, .asm_f1c38
+ ld a, [wXCoord]
+ cp a, $c
+ 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
+ ld [hJoyHeld], a
+ ld hl, Museum1FText_f1d02
+ call PrintText
+ call YesNoChoice
+ ld a, [wCurrentMenuItem]
+ and a
+ jr nz, .asm_f1cbf
+ xor a
+ ld [hMoney], a
+ ld [hMoney + 1], a
+ ld a, $50
+ ld [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:
+ TX_FAR _Museum1FText_5c21a
+ db "@"
+
+Museum1FText_f1d02:
+ TX_FAR _Museum1FText_5c21f
+ db "@"
+
+Museum1FText_f1d07:
+ TX_FAR _Museum1FText_5c224
+ db "@"
+
+Museum1FText_f1d0c:
+ TX_FAR _Museum1FText_5c229
+ db "@"
+
+Museum1FText_f1d11:
+ TX_FAR _Museum1FText_5c22e
+ db "@"
+
+Museum1FText_f1d16:
+ TX_FAR _Museum1FText_5c233
+ db "@"
+
+Museum1FText_f1d1b:
+ TX_FAR _Museum1FText_5c238
+ db "@"
+
+Museum1FText_f1d20:
+ TX_FAR _Museum1FText_5c23d
+ db "@"
+
+Museum1FText_f1d25:
+ TX_FAR _Museum1FText_5c242
+ db "@"
+
+Func_f1d2a:
+ ld hl, Museum1FText_f1d31
+ call PrintText
+ ret
+
+Museum1FText_f1d31:
+ TX_FAR _Museum1FText_5c251
+ db "@"
+
+Func_f1d36:
+ CheckEvent EVENT_GOT_OLD_AMBER
+ jr nz, .asm_f1d64
+ ld hl, Museum1FText_f1d6b
+ call PrintText
+ lb bc, OLD_AMBER, 1
+ call GiveItem
+ jr nc, .asm_f1d5f
+ SetEvent EVENT_GOT_OLD_AMBER
+ ld a, HS_OLD_AMBER
+ ld [wMissableObjectIndex], a
+ predef HideObject
+ ld hl, Museum1FText_f1d70
+ jr .asm_f1d67
+
+.asm_f1d5f
+ ld hl, Museum1FText_f1d7b
+ jr .asm_f1d67
+
+.asm_f1d64
+ ld hl, Museum1FText_f1d76
+.asm_f1d67
+ call PrintText
+ ret
+
+Museum1FText_f1d6b:
+ TX_FAR _Museum1FText_5c28e
+ db "@"
+
+Museum1FText_f1d70:
+ TX_FAR _ReceivedOldAmberText
+ TX_SFX_ITEM_1
+ db "@"
+
+Museum1FText_f1d76:
+ TX_FAR _Museum1FText_5c299
+ db "@"
+
+Museum1FText_f1d7b:
+ TX_FAR _Museum1FText_5c29e
+ db "@"
+
+Func_f1d80:
+ ld hl, Museum1FText_f1d87
+ call PrintText
+ ret
+
+Museum1FText_f1d87:
+ TX_FAR _Museum1FText_5c2ad
+ db "@"
+
+Func_f1d8c:
+ ld hl, Museum1FText_f1d93
+ call PrintText
+ ret
+
+Museum1FText_f1d93:
+ TX_FAR _Museum1FText_5c2bc
+ db "@"
diff --git a/scripts/Museum2F.asm b/scripts/Museum2F.asm
index ce4d3d81..e97b8ded 100755
--- 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:
db "@"
Museum2FText5:
+ TX_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:
TX_FAR _Museum2FText5
db "@"
+Museum2FText_5c213:
+ TX_FAR _Museum2FPikachuText1
+ db "@"
+
+Museum2FText_5c218:
+ TX_FAR _Museum2FPikachuText2
+ db "@"
+
Museum2FText6:
TX_FAR _Museum2FText6
db "@"
diff --git a/scripts/OaksLab.asm b/scripts/OaksLab.asm
index 11abdf65..04f31d2a 100755
--- 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
ld [H_SPRITEINDEX], a
ld de, OakEntryMovement
call MoveSprite
@@ -90,7 +95,7 @@ OaksLabScript3:
xor a
ld [hSpriteFacingDirection], a
call SetSpriteFacingDirectionAndDelay
- ld a, $5
+ ld a, $3
ld [H_SPRITEINDEX], a
xor a
ld [hSpriteFacingDirection], a
@@ -115,7 +120,6 @@ OaksLabScript4:
ld a, SPRITE_FACING_UP
ld [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
ld [hSpriteIndexOrTextID], a
call DisplayTextID
call Delay3
- ld a, $12
+ ld a, $e
ld [hSpriteIndexOrTextID], a
call DisplayTextID
call Delay3
- ld a, $13
+ ld a, $2
+ ld [wSpriteStateData1 + 1 * $10 + 1], a
+ ld a, SPRITE_FACING_UP
+ ld [wSpriteStateData1 + 1 * $10 + 9], a
+ ld a, $f
ld [hSpriteIndexOrTextID], a
call DisplayTextID
call Delay3
- ld a, $14
+ ld a, $10
ld [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
ld [H_SPRITEINDEX], a
xor a ; SPRITE_FACING_DOWN
ld [hSpriteFacingDirection], a
@@ -165,7 +173,7 @@ OaksLabScript6:
ld [hSpriteFacingDirection], a
call SetSpriteFacingDirectionAndDelay
call UpdateSprites
- ld a, $c
+ ld a, $a
ld [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 $FF
-
-.MiddleBallMovement2
- db NPC_MOVEMENT_DOWN
- db NPC_MOVEMENT_RIGHT
- db NPC_MOVEMENT_RIGHT
- db NPC_MOVEMENT_RIGHT
- db $FF
-
-.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 $FF
-
-.RightBallMovement2
- db NPC_MOVEMENT_DOWN
- db NPC_MOVEMENT_RIGHT
- db NPC_MOVEMENT_RIGHT
- db NPC_MOVEMENT_RIGHT
- db NPC_MOVEMENT_RIGHT
- db $FF
-
-.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
- ld [H_SPRITEINDEX], a
- ld a, $4
- ld [H_SPRITEDATAOFFSET], a
- call GetPointerWithinSpriteStateData1
- push hl
- ld [hl], $4c
- inc hl
- inc hl
- ld [hl], $0
- pop hl
- inc h
- ld [hl], $8
- inc hl
- ld [hl], $9
- 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 ; not yet terminated!
-.LeftBallMovement2
- db NPC_MOVEMENT_RIGHT
- db $FF
-
-.moveBlue
ld a, $1
- ld [H_SPRITEINDEX], a
+ ld [hSpriteIndexOrTextID], a
+ ld de, .SonyPushesPlayerAwayFromEeveeBall
call MoveSprite
-
ld a, $9
ld [wOaksLabCurScript], a
ret
+.SonyPushesPlayerAwayFromEeveeBall
+ 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
ld [H_SPRITEINDEX], a
ld a, SPRITE_FACING_UP
ld [hSpriteFacingDirection], a
call SetSpriteFacingDirectionAndDelay
- ld a, $d
- ld [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, 1
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
+ ld [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
- ld [H_SPRITEINDEX], a
- ld a, SPRITE_FACING_UP
- ld [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
ld [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
- ld [H_SPRITEINDEX], a
- xor a ; SPRITE_FACING_DOWN
+ ld [hSpriteIndexOrTextID], a
+ xor a
ld [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
ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld a, $1
ld [hNPCPlayerRelativePosPerspective], a
ld a, $1
swap a
- ld [hNPCSpriteOffset], a
+ ld [hNPCPlayerYDistance], a
predef CalcPositionOfPlayerRelativeToNPC
ld a, [hNPCPlayerYDistance]
dec a
@@ -368,40 +330,25 @@ OaksLabScript10:
predef FindPathToPlayer
ld de, wNPCMovementDirections2
ld a, $1
- ld [H_SPRITEINDEX], a
+ ld [hSpriteIndexOrTextID], 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_SONY1
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, $3
+ jr nz, .asm_1c660
+ ld b, $2
+.asm_1c660
+ 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
- ld [H_SPRITEINDEX], a
- xor a ; SPRITE_FACING_DOWN
- ld [hSpriteFacingDirection], a
- call SetSpriteFacingDirectionAndDelay
+ ld a, $2
+ ld [wSpriteStateData1 + 1 * $10 + 1], a
+ xor a
+ ld [wSpriteStateData1 + 1 * $10 + 9], 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
ld [hSpriteIndexOrTextID], a
call DisplayTextID
callba Music_RivalAlternateStart
ld a, $1
- ld [H_SPRITEINDEX], a
- ld de, .RivalExitMovement
+ ld [hSpriteIndexOrTextID], a
+ 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
- db $E0 ; change sprite facing direction
- db NPC_MOVEMENT_DOWN
- db NPC_MOVEMENT_DOWN
- db NPC_MOVEMENT_DOWN
- db NPC_MOVEMENT_DOWN
- db NPC_MOVEMENT_DOWN
- db $FF
+.OaksLabMovement_RivalWalksOut1
+ db $e0
+ db $00
+ db $04
+ db $04
+ db $04
+ db $04
+ db $04
+ db $ff
-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 [wSpriteStateData1 + 9], a
jr .done
.turnPlayerLeft
ld a, SPRITE_FACING_LEFT
- ld [wSpriteStateData1 + 9], a
jr .done
.turnPlayerDown
cp $4
ret nz
- xor a ; ld a, SPRITE_FACING_DOWN
- ld [wSpriteStateData1 + 9], a
+ xor 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
+ callba SchedulePikachuSpawnForAfterText
+ call EnablePikachuOverworldSpriteDrawing
+ ld a, $1a
+ ld [hSpriteIndexOrTextID], a
+ call DisplayTextID
+ ld a, $12
+ ld [wOaksLabCurScript], a
+ ret
+
+OaksLabScript18:
+ ld a, $1b
+ ld [hSpriteIndexOrTextID], a
+ call DisplayTextID
+ xor a
+ ld [wJoyIgnore], a
+ ld a, $16
+ ld [wOaksLabCurScript], a
+ ret
+
+OaksLabScript19:
xor a
ld [hJoyHeld], a
call EnableAutoTextBoxDrawing
- ld a, $ff
- ld [wNewSoundID], a
- call PlaySound
+ call StopAllMusic
callba Music_RivalAlternateStart
- ld a, $15
+ ld a, $13
ld [hSpriteIndexOrTextID], a
call DisplayTextID
- call OaksLabScript_1d02b
+ callab Func_f1be0
+ call OaksLabScript_1c8b9
ld a, HS_OAKS_LAB_RIVAL
ld [wMissableObjectIndex], a
predef ShowObject
@@ -530,50 +513,50 @@ OaksLabScript15:
call FillMemory
ld [hl], $ff
ld a, $1
- ld [H_SPRITEINDEX], a
+ ld [hSpriteIndexOrTextID], a
ld de, wNPCMovementDirections2
call MoveSprite
-
- ld a, $10
+ ld a, $14
ld [wOaksLabCurScript], a
ret
-OaksLabScript_1cefd:
+OaksLabScript_1c78e:
ld a, $1
- ld [H_SPRITEINDEX], a
+ ld [hSpriteIndexOrTextID], a
ld a, SPRITE_FACING_UP
ld [hSpriteFacingDirection], a
call SetSpriteFacingDirectionAndDelay
- ld a, $8
- ld [H_SPRITEINDEX], a
- xor a ; SPRITE_FACING_DOWN
+ ld a, $6
+ ld [hSpriteIndexOrTextID], a
+ xor a
ld [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
ld [hSpriteIndexOrTextID], a
call DisplayTextID
call DelayFrame
- call OaksLabScript_1cefd
- ld a, $17
+ call OaksLabScript_1c78e
+ ld a, $15
ld [hSpriteIndexOrTextID], a
call DisplayTextID
call DelayFrame
- call OaksLabScript_1cefd
- ld a, $18
+ call OaksLabScript_1c78e
+ ld a, $16
ld [hSpriteIndexOrTextID], a
call DisplayTextID
call DelayFrame
- ld a, $19
+ ld a, $17
ld [hSpriteIndexOrTextID], a
call DisplayTextID
call Delay3
@@ -583,20 +566,22 @@ OaksLabScript16:
ld a, HS_POKEDEX_2
ld [wMissableObjectIndex], a
predef HideObject
- call OaksLabScript_1cefd
- ld a, $1a
+ call OaksLabScript_1c78e
+ ld a, $18
ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld a, $1
- ld [H_SPRITEINDEX], a
+ ld [hSpriteIndexOrTextID], a
ld a, SPRITE_FACING_RIGHT
ld [hSpriteFacingDirection], a
call SetSpriteFacingDirectionAndDelay
call Delay3
- ld a, $1b
+ ld a, $19
ld [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
@@ -608,23 +593,20 @@ OaksLabScript16:
ld b, 0
ld c, a
ld hl, wNPCMovementDirections2
- xor a ; NPC_MOVEMENT_DOWN
+ xor a
call FillMemory
ld [hl], $ff
- ld a, $ff
- ld [wNewSoundID], a
- call PlaySound
+ call StopAllMusic
callba Music_RivalAlternateStart
ld a, $1
- ld [H_SPRITEINDEX], a
+ ld [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,21 +620,18 @@ 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:
ld hl, wBagItems
- ld bc, $0000
+ ld bc, 0
.loop
ld a, [hli]
cp $ff
@@ -662,47 +641,52 @@ OaksLabScript_RemoveParcel:
inc hl
inc c
jr .loop
+
.foundParcel
ld hl, wNumBagItems
ld a, c
ld [wWhichPokemon], a
- ld a, $1
+ ld a, 1
ld [wItemQuantity], a
- jp RemoveItemFromInventory
+ call RemoveItemFromInventory
+ ret
-OaksLabScript_1d02b:
+OaksLabScript_1c8b9:
ld a, $7c
ld [$ffeb], a
ld a, $8
ld [$ffee], a
ld a, [wYCoord]
- cp $3
- jr nz, .asm_1d045
+ cp 3
+ jr nz, .asm_1c8d3
ld a, $4
ld [wNPCMovementDirections2Index], a
ld a, $30
ld b, $b
- 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, $a
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
ld [$ffec], a
ld a, b
ld [$ffed], a
@@ -716,7 +700,7 @@ OaksLabScript_1d076:
ld a, l
ld [wMapTextPtr], a
ld a, h
- ld [wMapTextPtr+1], a
+ ld [wMapTextPtr + 1], a
ret
OaksLab_TextPointers:
@@ -758,8 +742,6 @@ OaksLab_TextPointers2:
dw OaksLabText7
dw OaksLabText8
dw OaksLabText9
- dw OaksLabText10
- dw OaksLabText11
OaksLabText1:
TX_ASM
@@ -769,7 +751,7 @@ OaksLabText1:
call PrintText
jr .done
.beforeChooseMon
- bit 2, a
+ CheckEventReuseA EVENT_GOT_STARTER
jr nz, .afterChooseMon
ld hl, OaksLabText40
call PrintText
@@ -794,42 +776,12 @@ OaksLabText41:
OaksLabText2:
TX_ASM
- ld a, STARTER2
- ld [wRivalStarterTemp], a
- ld a, $3
- ld [wRivalStarterBallSpriteIndex], a
- ld a, STARTER1
- ld b, $2
- jr OaksLabScript_1d133
-
-OaksLabText3:
- TX_ASM
- ld a, STARTER3
- ld [wRivalStarterTemp], a
- ld a, $4
- ld [wRivalStarterBallSpriteIndex], a
- ld a, STARTER2
- ld b, $3
- jr OaksLabScript_1d133
-
-OaksLabText4:
- TX_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 +790,107 @@ OaksLabText39:
TX_FAR _OaksLabText39
db "@"
-OaksLabScript_1d157:
- ld a, $5
- ld [H_SPRITEINDEX], a
- ld a, $9
- ld [H_SPRITEDATAOFFSET], a
- call GetPointerWithinSpriteStateData1
- ld [hl], SPRITE_FACING_DOWN
- ld a, $1
- ld [H_SPRITEINDEX], a
- ld a, $9
- ld [H_SPRITEDATAOFFSET], 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:
- TX_FAR _OaksLabCharmanderText
- db "@"
-
-OaksLabLookAtSquirtle:
- ld hl, OaksLabSquirtleText
- jr OaksLabMonChoiceMenu
-OaksLabSquirtleText:
- TX_FAR _OaksLabSquirtleText
- db "@"
-
-OaksLabLookAtBulbasaur:
- ld hl, OaksLabBulbasaurText
- jr OaksLabMonChoiceMenu
-OaksLabBulbasaurText:
- TX_FAR _OaksLabBulbasaurText
- db "@"
-
-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:
- TX_FAR _OaksLabMonEnergeticText
- db "@"
-
-OaksLabReceivedMonText:
- TX_FAR _OaksLabReceivedMonText
- TX_SFX_KEY_ITEM
- db "@"
-
-OaksLabScript_1d22d:
- ld a, $5
- ld [H_SPRITEINDEX], a
- ld a, $9
- ld [H_SPRITEDATAOFFSET], a
- call GetPointerWithinSpriteStateData1
- ld [hl], $0
- ld hl, OaksLabLastMonText
- call PrintText
jp TextScriptEnd
-OaksLabLastMonText:
- TX_FAR _OaksLabLastMonText
- db "@"
-
-OaksLabText32:
-OaksLabText5:
+OaksLabText3:
TX_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:
- TX_FAR _OaksLabText_1d2f0
+OaksLabText_1ca72:
+ TX_FAR _OaksLabPikachuText
db "@"
-OaksLabText_1d2f5:
+OaksLabText_1ca77:
TX_FAR _OaksLabText_1d2f5
db "@"
-OaksLabText_1d2fa:
+OaksLabText_1ca7c:
TX_FAR _OaksLabText_1d2fa
db "@"
@@ -1064,36 +914,36 @@ OaksLabPleaseVisitText:
TX_FAR _OaksLabPleaseVisitText
db "@"
-OaksLabText_1d31d:
+OaksLabText_1ca9f:
TX_FAR _OaksLabText_1d31d
db "@"
-OaksLabText7:
-OaksLabText6:
+OaksLabText4:
+OaksLabText5:
TX_ASM
- ld hl, OaksLabText_1d32c
+ ld hl, OaksLabText_1caae
call PrintText
jp TextScriptEnd
-OaksLabText_1d32c:
+OaksLabText_1caae:
TX_FAR _OaksLabText_1d32c
db "@"
-OaksLabText8:
+OaksLabText6:
TX_FAR _OaksLabText8
db "@"
-OaksLabText9:
+OaksLabText7:
TX_ASM
- ld hl, OaksLabText_1d340
+ ld hl, OaksLabText_1cac2
call PrintText
jp TextScriptEnd
-OaksLabText_1d340:
+OaksLabText_1cac2:
TX_FAR _OaksLabText_1d340
db "@"
-OaksLabText17:
+OaksLabText13:
TX_ASM
ld hl, OaksLabRivalWaitingText
call PrintText
@@ -1103,7 +953,7 @@ OaksLabRivalWaitingText:
TX_FAR _OaksLabRivalWaitingText
db "@"
-OaksLabText18:
+OaksLabText14:
TX_ASM
ld hl, OaksLabChooseMonText
call PrintText
@@ -1113,7 +963,7 @@ OaksLabChooseMonText:
TX_FAR _OaksLabChooseMonText
db "@"
-OaksLabText19:
+OaksLabText15:
TX_ASM
ld hl, OaksLabRivalInterjectionText
call PrintText
@@ -1123,7 +973,7 @@ OaksLabRivalInterjectionText:
TX_FAR _OaksLabRivalInterjectionText
db "@"
-OaksLabText20:
+OaksLabText16:
TX_ASM
ld hl, OaksLabBePatientText
call PrintText
@@ -1133,38 +983,89 @@ OaksLabBePatientText:
TX_FAR _OaksLabBePatientText
db "@"
-OaksLabText12:
+OaksLabText17:
TX_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:
- TX_FAR _OaksLabLeavingText
+OaksLabRivalTakesText1:
+ TX_FAR _OaksLabRivalTakesText1
db "@"
-OaksLabText13:
+OaksLabRivalTakesText2:
+ TX_FAR _OaksLabRivalTakesText2
+ TX_SFX_KEY_ITEM
+ db "@"
+
+OaksLabRivalTakesText3:
+ TX_FAR _OaksLabRivalTakesText3
+ db "@"
+
+OaksLabRivalTakesText4:
+ TX_FAR _OaksLabRivalTakesText4
+ db "@"
+
+OaksLabRivalTakesText5:
+ TX_FAR _OaksLabRivalTakesText5
+ db "@"
+
+OaksLabText18:
TX_ASM
- ld hl, OaksLabRivalPickingMonText
+ ld a, 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, 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:
- TX_FAR _OaksLabRivalPickingMonText
+OaksLabOakGivesText:
+ TX_FAR _OaksLabOakGivesText
db "@"
-OaksLabText14:
+OaksLabRecievedText:
+ TX_FAR _OaksLabReceivedText
+ TX_SFX_KEY_ITEM
+ db "@"
+
+OaksLabText10:
TX_ASM
- ld hl, OaksLabRivalReceivedMonText
+ ld hl, OaksLabLeavingText
call PrintText
jp TextScriptEnd
-OaksLabRivalReceivedMonText:
- TX_FAR _OaksLabRivalReceivedMonText
- TX_SFX_KEY_ITEM
+OaksLabLeavingText:
+ TX_FAR _OaksLabLeavingText
db "@"
-OaksLabText15:
+OaksLabText11:
TX_ASM
ld hl, OaksLabRivalChallengeText
call PrintText
@@ -1174,15 +1075,15 @@ OaksLabRivalChallengeText:
TX_FAR _OaksLabRivalChallengeText
db "@"
-OaksLabText_1d3be:
+OaksLabRivalDefeatedText:
TX_FAR _OaksLabText_1d3be
db "@"
-OaksLabText_1d3c3:
+OaksLabRivalBeatYouText:
TX_FAR _OaksLabText_1d3c3
db "@"
-OaksLabText16:
+OaksLabText12:
TX_ASM
ld hl, OaksLabRivalToughenUpText
call PrintText
@@ -1192,42 +1093,64 @@ OaksLabRivalToughenUpText:
TX_FAR _OaksLabRivalToughenUpText
db "@"
-OaksLabText21:
+OaksLabText26:
+ TX_ASM
+ ldpikacry e, PikachuCry2
+ callab PlayPikachuSoundClip
+ ld hl, OaksLabPikachuDislikesPokeballsText1
+ call PrintText
+ jp TextScriptEnd
+
+OaksLabPikachuDislikesPokeballsText1:
+ TX_FAR _OaksLabPikachuDislikesPokeballsText1
+ db "@"
+
+OaksLabText27:
+ TX_ASM
+ ld hl, OaksLabPikachuDislikesPokeballsText2
+ call PrintText
+ jp TextScriptEnd
+
+OaksLabPikachuDislikesPokeballsText2:
+ TX_FAR _OaksLabPikachuDislikesPokeballsText2
+ db "@"
+
+OaksLabText19:
TX_FAR _OaksLabText21
db "@"
-OaksLabText22:
+OaksLabText20:
TX_FAR _OaksLabText22
db "@"
-OaksLabText23:
+OaksLabText21:
TX_FAR _OaksLabText23
db "@"
-OaksLabText24:
+OaksLabText22:
TX_FAR _OaksLabText24
db "@"
-OaksLabText25:
+OaksLabText23:
TX_FAR _OaksLabText25
TX_SFX_KEY_ITEM
db "@"
-OaksLabText26:
+OaksLabText24:
TX_FAR _OaksLabText26
db "@"
-OaksLabText27:
+OaksLabText25:
TX_FAR _OaksLabText27
db "@"
-OaksLabText11:
-OaksLabText10:
+OaksLabText8:
+OaksLabText9:
TX_ASM
- ld hl, OaksLabText_1d405
+ ld hl, OaksLabText_1c31d
call PrintText
jp TextScriptEnd
-OaksLabText_1d405:
+OaksLabText_1c31d:
TX_FAR _OaksLabText_1d405
db "@"
diff --git a/scripts/OaksLab2.asm b/scripts/OaksLab2.asm
new file mode 100755
index 00000000..5e4e98a4
--- /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 5ad7d40f..fbdee4bc 100755
--- 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
ld [hJoyHeld], a
- ld a, PLAYER_DIR_DOWN
+ ld a, $ff
+ ld [wJoyIgnore], a
+ ld a, PLAYER_DIR_UP
ld [wPlayerMovingDirection], a
- ld a, $FF
- call PlaySound ; stop music
+ call StopAllMusic
ld a, BANK(Music_MeetProfOak)
ld c, a
- ld a, MUSIC_MEET_PROF_OAK ; “oak appears” music
+ ld a, MUSIC_MEET_PROF_OAK
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, wSpriteStateData2 + 1 * $10 + 4
+ ld a, $8
+ ld [hli], a
+ ld a, $e
+ ld [hl], a
ld a, HS_PALLET_TOWN_OAK
ld [wMissableObjectIndex], a
predef ShowObject
; trigger the next script
+ ld a, $2
+ ld [wSpriteStateData1 + 1 * $10 + 1], a
+ ld a, SPRITE_FACING_UP
+ ld [wSpriteStateData1 + 1 * $10 + 9], a
ld a, 2
ld [wPalletTownCurScript], a
ret
PalletTownScript2:
- ld a, 1
- ld [H_SPRITEINDEX], a
- ld a, SPRITE_FACING_UP
- ld [hSpriteFacingDirection], a
- call SetSpriteFacingDirectionAndDelay
call Delay3
- ld a, 1
+ ld a, 0
ld [wYCoord], a
ld a, 1
ld [hNPCPlayerRelativePosPerspective], a
@@ -81,8 +95,6 @@ PalletTownScript2:
ld a, 1 ; oak
ld [H_SPRITEINDEX], a
call MoveSprite
- ld a, $FF
- ld [wJoyIgnore], a
; trigger the next script
ld a, 3
@@ -93,47 +105,106 @@ PalletTownScript3:
ld a, [wd730]
bit 0, a
ret nz
- xor a ; ld a, SPRITE_FACING_DOWN
- ld [wSpriteStateData1 + 9], 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 [wSpriteStateData1 + 1 * $10 + 1], a
+ ld a, SPRITE_FACING_UP
+ ld [wSpriteStateData1 + 1 * $10 + 9], a
ld a, 1
ld [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 [wSpriteStateData1 + 1 * $10 + 1], 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 [wSpriteStateData1 + 1 * $10 + 9], 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, 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
+ ld [hSpriteIndexOrTextID], a
+ call DisplayTextID
+ ld a, $2
+ ld [wSpriteStateData1 + 1 * $10 + 1], a
+ ld a, SPRITE_FACING_UP
+ ld [wSpriteStateData1 + 1 * $10 + 9], a
+ ld a, $8
+ ld [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
- ld a, 1
+ ld a, $1
ld [wNPCMovementScriptPointerTableNum], a
ld a, [H_LOADEDROMBANK]
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?
+ and a
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
- jr nz, .next
+ jr nz, .asm_18f9e
+ and $3 ; (EVENT_GOT_TOWN_MAP | EVENT_ENTERED_BLUES_HOUSE)
+ cp $3
+ jr nz, .asm_18f9e
SetEvent EVENT_DAISY_WALKING
ld a, HS_DAISY_SITTING
ld [wMissableObjectIndex], a
@@ -141,11 +212,12 @@ PalletTownScript5:
ld a, HS_DAISY_WALKING
ld [wMissableObjectIndex], a
predef_jump ShowObject
-.next
+
+.asm_18f9e
CheckEvent EVENT_GOT_POKEBALLS_FROM_OAK
ret z
SetEvent EVENT_PALLET_AFTER_GETTING_POKEBALLS_2
-PalletTownScript6:
+PalletTownScript9:
ret
PalletTown_TextPointers:
@@ -156,6 +228,7 @@ PalletTown_TextPointers:
dw PalletTownText5
dw PalletTownText6
dw PalletTownText7
+ dw PalletTownText8
PalletTownText1:
TX_ASM
@@ -167,7 +240,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,38 +256,47 @@ OakAppearsText:
TX_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:
TX_FAR _OakWalksUpText
db "@"
-PalletTownText2: ; girl
+PalletTownText_19002:
+ TX_FAR _OakWhewText
+ db "@"
+
+PalletTownText8: ; girl
+ TX_FAR _OakGrassText
+ db "@"
+
+PalletTownText2: ; fat man
TX_FAR _PalletTownText2
db "@"
-PalletTownText3: ; fat man
+PalletTownText3: ; sign by lab
TX_FAR _PalletTownText3
db "@"
-PalletTownText4: ; sign by lab
+PalletTownText4: ; sign by fence
TX_FAR _PalletTownText4
db "@"
-PalletTownText5: ; sign by fence
+PalletTownText5: ; sign by Red’s house
TX_FAR _PalletTownText5
db "@"
-PalletTownText6: ; sign by Red’s house
+PalletTownText6: ; sign by Blue’s house
TX_FAR _PalletTownText6
db "@"
-PalletTownText7: ; sign by Blue’s house
+PalletTownText7:
TX_FAR _PalletTownText7
db "@"
diff --git a/scripts/PewterCity.asm b/scripts/PewterCity.asm
index 18296675..63d0fe71 100755
--- 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
@@ -26,7 +29,7 @@ PewterCityScript_1925e:
ld hl, CoordsData_19277
call ArePlayerCoordsInArray
ret nc
- ld a, $f0
+ ld a, $fc
ld [wJoyIgnore], a
ld a, $5
ld [hSpriteIndexOrTextID], a
@@ -48,9 +51,9 @@ PewterCityScript1:
ld a, SPRITE_FACING_UP
ld [hSpriteFacingDirection], a
call SetSpriteFacingDirectionAndDelay
- ld a, ($3 << 4) | SPRITE_FACING_UP
+ ld a, SPRITE_FACING_UP
ld [hSpriteImageIndex], a
- call SetSpriteImageIndexAfterSettingFacingDirection
+ call SpriteFunc_34a1
call PlayDefaultMusic
ld hl, wFlags_0xcd60
set 4, [hl]
@@ -115,10 +118,7 @@ PewterCityScript4:
ld [H_SPRITEINDEX], a
ld a, SPRITE_FACING_LEFT
ld [hSpriteFacingDirection], a
- call SetSpriteFacingDirectionAndDelay
- ld a, ($1 << 4) | SPRITE_FACING_LEFT
- ld [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 cf02b141..4ddec77e 100755
--- a/scripts/PewterGym.asm
+++ b/scripts/PewterGym.asm
@@ -14,7 +14,8 @@ PewterGym_Script:
PewterGymScript_5c3a4:
ld hl, Gym1CityName
ld de, Gym1LeaderName
- jp LoadGymLeaderAndCityName
+ call LoadGymLeaderAndCityName
+ ret
Gym1CityName:
db "PEWTER CITY@"
@@ -41,7 +42,6 @@ PewterGymScript3:
jp z, PewterGymScript_5c3bf
ld a, $f0
ld [wJoyIgnore], a
-
PewterGymScript_5c3df:
ld a, $4
ld [hSpriteIndexOrTextID], a
@@ -158,7 +158,7 @@ PewterGymText6:
PewterGymText_5c4bc:
TX_FAR _PewterGymText_5c4bc
- TX_SFX_LEVEL_UP ; probably supposed to play SFX_GET_ITEM_1 but the wrong music bank is loaded
+ TX_SFX_ITEM_1
TX_FAR _PewterGymText_5c4c1
db "@"
@@ -191,6 +191,9 @@ PewterGymText3:
ld a, [wCurrentMenuItem]
and a
jr nz, .asm_5c4fe
+ ld a, [wd472]
+ bit 7, a
+ jp nz, .asm_5c3fa
ld hl, PewterGymText_5c51a
call PrintText
jr .asm_5c504
@@ -207,6 +210,11 @@ PewterGymText3:
.asm_5c512
jp TextScriptEnd
+.asm_5c3fa
+ ld hl, PewterGymText_5c41c
+ call PrintText
+ jp TextScriptEnd
+
PewterGymText_5c515:
TX_FAR _PewterGymText_5c515
db "@"
@@ -226,3 +234,8 @@ PewterGymText_5c524:
PewterGymText_5c529:
TX_FAR _PewterGymText_5c529
db "@"
+
+PewterGymText_5c41c:
+ TX_FAR _PewterGymGuyText
+ db "@"
+
diff --git a/scripts/PewterMart.asm b/scripts/PewterMart.asm
index c71f8413..5b3e7617 100755
--- a/scripts/PewterMart.asm
+++ b/scripts/PewterMart.asm
@@ -14,6 +14,7 @@ PewterMartText2:
ld hl, .Text
call PrintText
jp TextScriptEnd
+
.Text
TX_FAR _PewterMartText2
db "@"
@@ -23,6 +24,7 @@ PewterMartText3:
ld hl, .Text
call PrintText
jp TextScriptEnd
+
.Text
TX_FAR _PewterMartText3
db "@"
diff --git a/scripts/PewterNidoranHouse.asm b/scripts/PewterNidoranHouse.asm
index a4e85e08..2f3f4145 100755
--- 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 22d2fb6b..add001bc 100755
--- 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:
TX_POKECENTER_NURSE
@@ -17,68 +22,18 @@ PewterPokecenterText2:
PewterJigglypuffText:
TX_ASM
- ld a, $1
- ld [wDoNotWaitForButtonPressAfterDisplayingText], a
- ld hl, .Text
- call PrintText
- 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
-.loop
- 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, .loop
-
- ld c, 48
- call DelayFrames
- call PlayDefaultMusic
+ callba PewterJigglypuff
jp TextScriptEnd
-.Text
- TX_FAR _PewterJigglypuffText
- db "@"
-
-JigglypuffFacingDirections:
- db $30 | SPRITE_FACING_DOWN
- db $30 | SPRITE_FACING_LEFT
- db $30 | SPRITE_FACING_UP
- db $30 | SPRITE_FACING_RIGHT
-JigglypuffFacingDirectionsEnd:
-
PewterTradeNurseText:
TX_CABLE_CLUB_RECEPTIONIST
+
+PewterPokecenterText5:
+ TX_ASM
+ callba Func_f1d98
+ jp TextScriptEnd
+
+PewterPokecenterText6:
+ TX_ASM
+ callab PokecenterChanseyText
+ jp TextScriptEnd
diff --git a/scripts/PewterPokecenter2.asm b/scripts/PewterPokecenter2.asm
new file mode 100755
index 00000000..3d4de3f7
--- /dev/null
+++ b/scripts/PewterPokecenter2.asm
@@ -0,0 +1,78 @@
+Func_f1d98:
+ ld hl, PewterPokecenterText_f1d9f
+ call PrintText
+ ret
+
+PewterPokecenterText_f1d9f:
+ TX_FAR _PewterPokecenterText3
+ db "@"
+
+PewterJigglypuff:
+ ld a, $1
+ ld [wDoNotWaitForButtonPressAfterDisplayingText], a
+ ld hl, .Text
+ 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
+.loop
+ 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, .loop
+
+ ld c, 48
+ call DelayFrames
+ call PlayDefaultMusic
+ ld a, [wd472]
+ bit 7, a
+ ret z
+ callab CheckPikachuFaintedOrStatused
+ ret c
+ call DisablePikachuFollowingPlayer
+ ret
+
+.Text
+ TX_FAR _PewterJigglypuffText
+ db "@"
+
+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 673d6011..3434f871 100755
--- 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
+ ld a, [hRandomAdd]
+ cp 25
+ call c, FanClubScript_59a44
+ ret
+
+FanClubScript_59a44:
+ ld a, [wd472]
+ bit 7, a
+ ret z
+ callab 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 [wSpriteStateData1 + 3 * $10 + 1], a ; Seel
+ xor a ; SPRITE_FACING_DOWN
+ ld [wSpriteStateData1 + 3 * $10 + 9], a
+ callab 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
TX_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:
TX_FAR PikachuFanBetterText
db "@"
+.yellowtext
+ TX_FAR PikachuFanPrintText
+ db "@"
+
FanClubText2:
; seel fan
TX_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:
TX_FAR SeelFanBetterText
db "@"
+.yellowtext
+ TX_FAR SeelFanPrintText
+ db "@"
+
FanClubText3:
; pikachu
TX_ASM
ld hl, .text
call PrintText
- ld a, PIKACHU
+ ld a, CLEFAIRY
call PlayCry
call WaitForSoundToFinish
jp TextScriptEnd
@@ -100,74 +177,131 @@ FanClubText4:
FanClubText5:
; chair
TX_ASM
- call FanClubBikeInBag
- jr nz, .nothingleft
-
- ld hl, .meetchairtext
+ CheckEventHL EVENT_152
+ jr z, .check_bike_voucher
+ ld hl, Text_59c1f
call PrintText
call YesNoChoice
ld a, [wCurrentMenuItem]
and a
- jr nz, .nothanks
+ jr z, .select_mon_to_print
+ ld hl, Text_59c24
+ jr .gbpals_print_text
- ; tell the story
- ld hl, .storytext
+.check_bike_voucher
+ CheckEvent EVENT_GOT_BIKE_VOUCHER
+ jr nz, .got_bike_voucher_already
+ ld hl, Text_59bfc
+ call PrintText
+ call YesNoChoice
+ ld a, [wCurrentMenuItem]
+ and a
+ jr nz, .declined_story
+ ld hl, Text_59c01
call PrintText
lb bc, BIKE_VOUCHER, 1
call GiveItem
- jr nc, .BagFull
- ld hl, .receivedvouchertext
+ jr nc, .no_room_for_voucher
+ ld hl, Text_59c06
call PrintText
SetEvent EVENT_GOT_BIKE_VOUCHER
- jr .done
-.BagFull
- ld hl, .bagfulltext
- call PrintText
- jr .done
-.nothanks
- ld hl, .nostorytext
- call PrintText
- jr .done
-.nothingleft
- ld hl, .finaltext
+ jp TextScriptEnd
+
+.no_room_for_voucher
+ ld hl, Text_59c1a
+ jr .gbpals_print_text
+
+.declined_story
+ ld hl, Text_59c10
+ jr .gbpals_print_text
+
+.got_bike_voucher_already
+ ld hl, Text_59c15
+.gbpals_print_text
+ push hl
+ call LoadGBPal
+ pop hl
call PrintText
-.done
jp TextScriptEnd
-.meetchairtext
+.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]
+ callab PrintFanClubPortrait
+ ld hl, wd730
+ res 6, [hl]
+ call GBPalWhiteOutWithDelay3
+ call ReloadTilesetTilePatterns
+ call RestoreScreenTilesAndReloadTilePatterns
+ call LoadScreenTilesFromBuffer2
+ call Delay3
+ call GBPalNormal
+ ld hl, Text_59c2e
+ ld a, [hOaksAideResult]
+ and a
+ jr nz, .gbpals_print_text
+ ld hl, Text_59c29
+ jr .gbpals_print_text
+
+Text_59bfc:
TX_FAR FanClubMeetChairText
db "@"
-.storytext
+Text_59c01:
TX_FAR FanClubChairStoryText
db "@"
-.receivedvouchertext
+Text_59c06:
TX_FAR ReceivedBikeVoucherText
TX_SFX_KEY_ITEM
TX_FAR ExplainBikeVoucherText
db "@"
-.nostorytext
+Text_59c10:
TX_FAR FanClubNoStoryText
db "@"
-.finaltext
+Text_59c15:
TX_FAR FanClubChairFinalText
db "@"
-.bagfulltext
+Text_59c1a:
TX_FAR FanClubBagFullText
db "@"
-FanClubText6:
- TX_FAR _FanClubText6
+Text_59c1f:
+ TX_FAR FanClubChairPrintText1
+ db "@"
+
+Text_59c24:
+ TX_FAR FanClubChairPrintText2
+ db "@"
+
+Text_59c29:
+ TX_FAR FanClubChairPrintText3
db "@"
-FanClubText7:
- TX_FAR _FanClubText7
+Text_59c2e:
+ TX_FAR FanClubChairPrintText4
db "@"
-FanClubText8:
- TX_FAR _FanClubText8
+FanClubText6:
+ TX_FAR _FanClubText6
db "@"
diff --git a/scripts/PokemonMansion1F.asm b/scripts/PokemonMansion1F.asm
index 41f40635..639a4acf 100755
--- a/scripts/PokemonMansion1F.asm
+++ b/scripts/PokemonMansion1F.asm
@@ -46,7 +46,7 @@ Mansion1ReplaceBlock:
ret
Mansion1Script_Switches:
- ld a, [wSpriteStateData1 + 9]
+ ld a, [wSpritePlayerStateData1FacingDirection]
cp SPRITE_FACING_UP
ret nz
xor a
diff --git a/scripts/PokemonMansion2F.asm b/scripts/PokemonMansion2F.asm
index a7b90bcd..8d05cdc9 100755
--- a/scripts/PokemonMansion2F.asm
+++ b/scripts/PokemonMansion2F.asm
@@ -42,7 +42,7 @@ Mansion2Script_5202f:
predef_jump ReplaceTileBlock
Mansion2Script_Switches:
- ld a, [wSpriteStateData1 + 9]
+ ld a, [wSpritePlayerStateData1FacingDirection]
cp SPRITE_FACING_UP
ret nz
xor a
diff --git a/scripts/PokemonMansion3F.asm b/scripts/PokemonMansion3F.asm
index ff172413..e19fec72 100755
--- a/scripts/PokemonMansion3F.asm
+++ b/scripts/PokemonMansion3F.asm
@@ -73,7 +73,7 @@ Mansion3Script_5225b:
ret
Mansion3Script_Switches:
- ld a, [wSpriteStateData1 + 9]
+ ld a, [wSpritePlayerStateData1FacingDirection]
cp SPRITE_FACING_UP
ret nz
xor a
diff --git a/scripts/PokemonMansionB1F.asm b/scripts/PokemonMansionB1F.asm
index 887b4762..0a668c09 100755
--- a/scripts/PokemonMansionB1F.asm
+++ b/scripts/PokemonMansionB1F.asm
@@ -44,7 +44,7 @@ Mansion4Script_523cf:
ret
Mansion4Script_Switches:
- ld a, [wSpriteStateData1 + 9]
+ ld a, [wSpritePlayerStateData1FacingDirection]
cp SPRITE_FACING_UP
ret nz
xor a
diff --git a/scripts/PokemonTower1F.asm b/scripts/PokemonTower1F.asm
index 66b5505c..b383c647 100755
--- 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 81f4c0b3..54f49cae 100755
--- a/scripts/PokemonTower2F.asm
+++ b/scripts/PokemonTower2F.asm
@@ -22,9 +22,7 @@ PokemonTower2Script0:
ld hl, CoordsData_6055e
call ArePlayerCoordsInArray
ret nc
- ld a, $ff
- ld [wNewSoundID], a
- call PlaySound
+ call StopAllMusic
ld c, BANK(Music_MeetRival)
ld a, MUSIC_MEET_RIVAL
call PlayMusic
@@ -71,14 +69,13 @@ PokemonTower2Script1:
ld de, MovementData_605b2
CheckEvent EVENT_POKEMON_TOWER_RIVAL_ON_LEFT
jr nz, .asm_60589
+ callab Func_f1e22
ld de, MovementData_605a9
.asm_60589
ld a, $1
ld [H_SPRITEINDEX], a
call MoveSprite
- ld a, $ff
- ld [wNewSoundID], a
- call PlaySound
+ call StopAllMusic
callba Music_RivalAlternateStart
ld a, $2
ld [wPokemonTower2FCurScript], a
@@ -144,21 +141,8 @@ PokemonTower2Text1:
call SaveEndBattleTextPointers
ld a, OPP_SONY2
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 100755
index 00000000..42659da3
--- /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 4b2a1827..e34edf66 100755
--- a/scripts/PokemonTower7F.asm
+++ b/scripts/PokemonTower7F.asm
@@ -1,76 +1,241 @@
PokemonTower7F_Script:
call EnableAutoTextBoxDrawing
- ld hl, PokemonTower7TrainerHeader0
- 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
+
+PokemonTower7Script0:
+ CheckEvent EVENT_BEAT_POKEMONTOWER_7_TRAINER_0
+ call z, PokemonTower7Script_60d2a
+ ret
-PokemonTower7Script2:
- ld hl, wFlags_0xcd60
- res 0, [hl]
- ld a, [wIsInBattle]
- cp $ff
- jp z, PokemonTower7Script_60d18
- call EndTrainerBattle
- ld a, $f0
+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
+ ld [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
ld [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
+ ld [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 [wSpriteStateData1 + 1 * $10 + 9], a
+ CheckEvent EVENT_BEAT_POKEMONTOWER_7_TRAINER_1
+ jr z, .asm_60dba
+ ld a, $c
+ ld [wSpriteStateData1 + 1 * $10 + 9], a
+.asm_60dba
+ ld a, $2
+ ld [wSpriteStateData1 + 1 * $10 + 1], 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
+ ld [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 [wSpriteStateData1 + $2 * $10 + $1], a
+ ld a, $8
+ ld [wSpriteStateData1 + $2 * $10 + $9], a
+ CheckEvent EVENT_BEAT_POKEMONTOWER_7_TRAINER_1
+ jr z, .asm_60dff
+ ld a, $0
+ ld [wSpriteStateData1 + $2 * $10 + $9], a
+.asm_60dff
+ call Delay3
+ ld a, $FF ^ (A_BUTTON | B_BUTTON)
+ ld [wJoyIgnore], a
+ ld a, $5
+ ld [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
+ ld [hJoyHeld], a
+ ld [wJoyIgnore], 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 [wSpriteStateData1 + 1 * $10 + 1], a
+ ld [wSpriteStateData1 + 2 * $10 + 1], a
+ xor a
+ ld [wSpriteStateData1 + 1 * $10 + 9], a
+ ld [wSpriteStateData1 + 2 * $10 + 9], a
+ ld a, $FF ^ (A_BUTTON | B_BUTTON)
+ ld [wJoyIgnore], a
+ ld a, $1
+ ld [wDoNotWaitForButtonPressAfterDisplayingText], a
+ ld a, $6
+ ld [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
- ld [wSpriteIndex], a
- ld [wTrainerHeaderFlagBit], a
- ld [wUnusedDA38], 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
+ ld [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
ld [wMissableObjectIndex], a
predef HideObject
ld a, SPRITE_FACING_UP
- ld [wSpriteStateData1 + 9], a
+ ld [wSpritePlayerStateData1FacingDirection], a
ld a, MR_FUJIS_HOUSE
ld [hWarpDestinationMap], a
ld a, $1
@@ -81,179 +246,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]
- ld [H_SPRITEINDEX], a
- jp MoveSprite
-.asm_60dde
- inc hl
-.asm_60ddf
- inc hl
- inc hl
- jr .asm_60dcb
-
-CoordsData_60de3:
- db $0C,$09
- dw MovementData_60e13
- db $0B,$0A
- dw MovementData_60e1b
- db $0B,$0B
- dw MovementData_60e22
- db $0B,$0C
- dw MovementData_60e22
- db $0A,$0C
- dw MovementData_60e28
- db $09,$0B
- dw MovementData_60e30
- db $09,$0A
- dw MovementData_60e22
- db $09,$09
- dw MovementData_60e22
- db $08,$09
- dw MovementData_60e37
- db $07,$0A
- dw MovementData_60e22
- db $07,$0B
- dw MovementData_60e22
- db $07,$0C
- dw 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 $FF
-
-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 $FF
-
-MovementData_60e22:
- db NPC_MOVEMENT_DOWN
- db NPC_MOVEMENT_DOWN
- db NPC_MOVEMENT_DOWN
- db NPC_MOVEMENT_DOWN
- db NPC_MOVEMENT_DOWN
- db $FF
-
-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 $FF
-
-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 $FF
-
-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 $FF
-
PokemonTower7F_TextPointers:
dw PokemonTower7Text1
dw PokemonTower7Text2
dw PokemonTower7Text3
- dw PokemonTower7FujiText
-
-PokemonTower7TrainerHeader0:
- dbEventFlagBit EVENT_BEAT_POKEMONTOWER_7_TRAINER_0
- db ($3 << 4) ; trainer's view range
- dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_7_TRAINER_0
- dw PokemonTower7BattleText1 ; TextBeforeBattle
- dw PokemonTower7AfterBattleText1 ; TextAfterBattle
- dw PokemonTower7EndBattleText1 ; TextEndBattle
- dw PokemonTower7EndBattleText1 ; TextEndBattle
-
-PokemonTower7TrainerHeader1:
- dbEventFlagBit EVENT_BEAT_POKEMONTOWER_7_TRAINER_1
- db ($3 << 4) ; trainer's view range
- dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_7_TRAINER_1
- dw PokemonTower7BattleText2 ; TextBeforeBattle
- dw PokemonTower7AfterBattleText2 ; TextAfterBattle
- dw PokemonTower7EndBattleText2 ; TextEndBattle
- dw PokemonTower7EndBattleText2 ; TextEndBattle
-
-PokemonTower7TrainerHeader2:
- dbEventFlagBit EVENT_BEAT_POKEMONTOWER_7_TRAINER_2
- db ($3 << 4) ; trainer's view range
- dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_7_TRAINER_2
- dw PokemonTower7BattleText3 ; TextBeforeBattle
- dw PokemonTower7AfterBattleText3 ; TextAfterBattle
- dw PokemonTower7EndBattleText3 ; TextEndBattle
- dw PokemonTower7EndBattleText3 ; TextEndBattle
-
- db $ff
+ dw PokemonTower7Text4
+ dw PokemonTower7Text5
+ dw PokemonTower7Text6
PokemonTower7Text1:
- TX_ASM
- ld hl, PokemonTower7TrainerHeader0
- call TalkToTrainer
- jp TextScriptEnd
-
PokemonTower7Text2:
+ db "@"
+
+PokemonTower7Text4:
+ TX_FAR _PokemonTowerJessieJamesText1
TX_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:
+ TX_FAR _PokemonTowerJessieJamesText2
+ db "@"
+
+PokemonTower7JessieJamesEndBattleText:
+ TX_FAR _PokemonTowerJessieJamesText3
+ db "@"
+
+PokemonTower7Text6:
+ TX_FAR _PokemonTowerJessieJamesText4
TX_ASM
- ld hl, PokemonTower7TrainerHeader2
- call TalkToTrainer
+ ld c, 64
+ call DelayFrames
jp TextScriptEnd
-PokemonTower7FujiText:
+PokemonTower7Text3:
TX_ASM
- ld hl, TowerRescueFujiText
+ ld hl, PokemonTower7Text_60f75
call PrintText
SetEvent EVENT_RESCUED_MR_FUJI
SetEvent EVENT_RESCUED_MR_FUJI_2
@@ -266,47 +306,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:
TX_FAR _TowerRescueFujiText
db "@"
-
-PokemonTower7BattleText1:
- TX_FAR _PokemonTower7BattleText1
- db "@"
-
-PokemonTower7EndBattleText1:
- TX_FAR _PokemonTower7EndBattleText1
- db "@"
-
-PokemonTower7AfterBattleText1:
- TX_FAR _PokemonTower7AfterBattleText1
- db "@"
-
-PokemonTower7BattleText2:
- TX_FAR _PokemonTower7BattleText2
- db "@"
-
-PokemonTower7EndBattleText2:
- TX_FAR _PokemonTower7EndBattleText2
- db "@"
-
-PokemonTower7AfterBattleText2:
- TX_FAR _PokemonTower7AfterBattleText2
- db "@"
-
-PokemonTower7BattleText3:
- TX_FAR _PokemonTower7BattleText3
- db "@"
-
-PokemonTower7EndBattleText3:
- TX_FAR _PokemonTower7EndBattleText3
- db "@"
-
-PokemonTower7AfterBattleText3:
- TX_FAR _PokemonTower7AfterBattleText3
- db "@"
diff --git a/scripts/PowerPlant.asm b/scripts/PowerPlant.asm
index 35b4893f..f720b6f8 100755
--- a/scripts/PowerPlant.asm
+++ b/scripts/PowerPlant.asm
@@ -7,7 +7,7 @@ PowerPlant_Script:
ld [wPowerPlantCurScript], a
ret
-PowerPlant_ScriptPointers
+PowerPlant_ScriptPointers:
dw CheckFightingMapTrainers
dw DisplayEnemyTrainerTextAndStartBattle
dw EndTrainerBattle
diff --git a/scripts/RedsHouse1F.asm b/scripts/RedsHouse1F.asm
index b982d71c..e4fa2094 100755
--- a/scripts/RedsHouse1F.asm
+++ b/scripts/RedsHouse1F.asm
@@ -1,5 +1,6 @@
RedsHouse1F_Script:
- jp EnableAutoTextBoxDrawing
+ call EnableAutoTextBoxDrawing
+ ret
RedsHouse1F_TextPointers:
dw RedsHouse1FText1
@@ -7,63 +8,10 @@ RedsHouse1F_TextPointers:
RedsHouse1FText1: ; Mom
TX_ASM
- ld a, [wd72e]
- bit 3, a
- jr nz, .heal ; if player has received a Pokémon from Oak, heal team
- ld hl, MomWakeUpText
- call PrintText
- jr .done
-.heal
- call MomHealPokemon
-.done
+ callab Func_f1b73
jp TextScriptEnd
-MomWakeUpText:
- TX_FAR _MomWakeUpText
- db "@"
-
-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:
- TX_FAR _MomHealText1
- db "@"
-MomHealText2:
- TX_FAR _MomHealText2
- db "@"
-
RedsHouse1FText2: ; TV
TX_ASM
- ld a, [wSpriteStateData1 + 9]
- cp SPRITE_FACING_UP
- ld hl, TVWrongSideText
- jr nz, .notUp
- ld hl, StandByMeText
-.notUp
- call PrintText
+ callab Func_f1bc4
jp TextScriptEnd
-
-StandByMeText:
- TX_FAR _StandByMeText
- db "@"
-
-TVWrongSideText:
- TX_FAR _TVWrongSideText
- db "@"
diff --git a/scripts/RedsHouse1F2.asm b/scripts/RedsHouse1F2.asm
new file mode 100755
index 00000000..8f44d30d
--- /dev/null
+++ b/scripts/RedsHouse1F2.asm
@@ -0,0 +1,58 @@
+Func_f1b73:
+ ld a, [wd72e]
+ bit 3, a
+ jp nz, MomHealPokemon ; if player has received a Pokémon from Oak, heal team
+ ld hl, MomWakeUpText
+ call PrintText
+ ret
+
+MomWakeUpText:
+ TX_FAR _MomWakeUpText
+ db "@"
+
+MomHealPokemon:
+ ld hl, MomHealText1
+ call PrintText
+ call GBFadeOutToWhite
+ call ReloadMapData
+ predef HealParty
+ ld a, MUSIC_PKMN_HEALED
+ ld [wNewSoundID], a
+ call PlaySound
+.loop
+ ld a, [wChannelSoundIDs]
+ cp MUSIC_PKMN_HEALED
+ jr z, .loop
+ ld a, [wMapMusicSoundID]
+ ld [wNewSoundID], a
+ call PlaySound
+ call GBFadeInFromWhite
+ ld hl, MomHealText2
+ call PrintText
+ ret
+
+MomHealText1:
+ TX_FAR _MomHealText1
+ db "@"
+MomHealText2:
+ TX_FAR _MomHealText2
+ db "@"
+
+Func_f1bc4:
+ ld hl, TVWrongSideText
+ ld a, [wSpritePlayerStateData1FacingDirection]
+ cp SPRITE_FACING_UP
+ jp nz, .notUp
+ ld hl, StandByMeText
+.notUp
+ call PrintText
+ ret
+
+StandByMeText:
+ TX_FAR _StandByMeText
+ db "@"
+
+TVWrongSideText:
+ TX_FAR _TVWrongSideText
+ db "@"
+
diff --git a/scripts/RedsHouse2F.asm b/scripts/RedsHouse2F.asm
index 5ec86678..e692a0fa 100755
--- 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
- ld [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 cbcd6318..2fcace67 100755
--- a/scripts/RockTunnelPokecenter.asm
+++ b/scripts/RockTunnelPokecenter.asm
@@ -7,9 +7,10 @@ RockTunnelPokecenter_TextPointers:
dw RockTunnelPokecenterText2
dw RockTunnelPokecenterText3
dw RockTunnelTradeNurseText
+ dw RockTunnelPokecenterText5
RockTunnelHealNurseText:
- db $ff
+ TX_POKECENTER_NURSE
RockTunnelPokecenterText2:
TX_FAR _RockTunnelPokecenterText2
@@ -20,4 +21,9 @@ RockTunnelPokecenterText3:
db "@"
RockTunnelTradeNurseText:
- db $f6
+ TX_CABLE_CLUB_RECEPTIONIST
+
+RockTunnelPokecenterText5:
+ TX_ASM
+ callab PokecenterChanseyText
+ jp TextScriptEnd
diff --git a/scripts/RocketHideoutB4F.asm b/scripts/RocketHideoutB4F.asm
index b2ce21f4..89fd37e1 100755
--- a/scripts/RocketHideoutB4F.asm
+++ b/scripts/RocketHideoutB4F.asm
@@ -1,5 +1,4 @@
RocketHideoutB4F_Script:
- call RocketHideout4Script_45473
call EnableAutoTextBoxDrawing
ld hl, RocketHideout4TrainerHeader0
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,60 +68,294 @@ RocketHideout4Script3:
ld [wCurMapScript], a
ret
+RocketHideout4Script0:
+ 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
+ ld [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
+ ld [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
+ ld [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 [wSpriteStateData1 + 2 * $10 + 1], a
+ ld a, SPRITE_FACING_LEFT
+ ld [wSpriteStateData1 + 2 * $10 + 9], a
+ CheckEvent EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_1
+ jr z, .asm_4564a
+ ld a, SPRITE_FACING_DOWN
+ ld [wSpriteStateData1 + 2 * $10 + 9], 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
+ ld [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 [wSpriteStateData1 + 3 * $10 + 1], a
+ ld a, SPRITE_FACING_DOWN
+ ld [wSpriteStateData1 + 3 * $10 + 9], a
+ CheckEvent EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_1
+ jr z, .asm_45697
+ ld a, SPRITE_FACING_RIGHT
+ ld [wSpriteStateData1 + 3 * $10 + 9], a
+.asm_45697
+ call Delay3
+ ld a, $c
+ ld [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
+ ld [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 [wSpriteStateData1 + 2 * $10 + 1], a
+ ld [wSpriteStateData1 + 3 * $10 + 1], a
+ xor a
+ ld [wSpriteStateData1 + 2 * $10 + 9], a
+ ld [wSpriteStateData1 + 3 * $10 + 9], a
+ ld a, $fc
+ ld [wJoyIgnore], a
+ ld a, $1
+ ld [wDoNotWaitForButtonPressAfterDisplayingText], a
+ ld a, $d
+ ld [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
+ ld [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
RocketHideout4TrainerHeader0:
- dbEventFlagBit EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_0
- db ($0 << 4) ; trainer's view range
- dwEventFlagAddress EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_0
- dw RocketHideout4BattleText2 ; TextBeforeBattle
- dw RocketHideout4AfterBattleText2 ; TextAfterBattle
- dw RocketHideout4EndBattleText2 ; TextEndBattle
- dw RocketHideout4EndBattleText2 ; TextEndBattle
-
-RocketHideout4TrainerHeader1:
- dbEventFlagBit EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_1
- db ($0 << 4) ; trainer's view range
- dwEventFlagAddress EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_1
- dw RocketHideout4BattleText3 ; TextBeforeBattle
- dw RocketHideout4AfterBattleText3 ; TextAfterBattle
- dw RocketHideout4EndBattleText3 ; TextEndBattle
- dw RocketHideout4EndBattleText3 ; TextEndBattle
-
-RocketHideout4TrainerHeader2:
dbEventFlagBit EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_2
- db ($1 << 4) ; trainer's view range
+ db ($1 << 4)
dwEventFlagAddress EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_2
- dw RocketHideout4BattleText4 ; TextBeforeBattle
- dw RocketHideout4AfterBattleText4 ; TextAfterBattle
- dw RocketHideout4EndBattleText4 ; TextEndBattle
- dw RocketHideout4EndBattleText4 ; TextEndBattle
-
+ dw RocketHideout4Trainer0BeforeText
+ dw RocketHideout4Trainer0AfterText
+ dw RocketHideout4Trainer0EndBattleText
+ dw RocketHideout4Trainer0EndBattleText
db $ff
RocketHideout4Text1:
+RocketHideout4Text2:
+ db "@"
+
+RocketHideout4Text10:
+ TX_FAR _RocketHideoutJessieJamesText1
+ TX_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:
+ TX_FAR _RocketHideoutJessieJamesText2
+ db "@"
+
+RocketHideout4JessieJamesEndBattleText:
+ TX_FAR _RocketHideoutJessieJamesText3
+ db "@"
+
+RocketHideout4Text12:
+ TX_FAR _RocketHideoutJessieJamesText4
+ TX_ASM
+ ld c, 64
+ call DelayFrames
+ jp TextScriptEnd
+
+RocketHideout4Text0:
TX_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
- ld a, [H_SPRITEINDEX]
+ ld a, [hSpriteIndexOrTextID]
ld [wSpriteIndex], a
call EngageMapTrainer
call InitBattleEnemyParameters
@@ -134,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:
TX_FAR _RocketHideout4Text_4557a
db "@"
-RocketHideout4Text_4557f:
+RocketHideout4Text_45809:
TX_FAR _RocketHideout4Text_4557f
db "@"
-RocketHideout4Text10:
+RocketHideout4Text9:
TX_FAR _RocketHideout4Text_45584
db "@"
-RocketHideout4Text2:
- TX_ASM
- ld hl, RocketHideout4TrainerHeader0
- call TalkToTrainer
- jp TextScriptEnd
-
-RocketHideout4BattleText2:
- TX_FAR _RocketHideout4BattleText2
- db "@"
-
-RocketHideout4EndBattleText2:
- TX_FAR _RocketHideout4EndBattleText2
- db "@"
-
-RocketHideout4AfterBattleText2:
- TX_FAR _RocketHide4AfterBattleText2
- db "@"
-
RocketHideout4Text3:
TX_ASM
- ld hl, RocketHideout4TrainerHeader1
- call TalkToTrainer
- jp TextScriptEnd
-
-RocketHideout4BattleText3:
- TX_FAR _RocketHideout4BattleText3
- db "@"
-
-RocketHideout4EndBattleText3:
- TX_FAR _RocketHideout4EndBattleText3
- db "@"
-
-RocketHideout4AfterBattleText3:
- TX_FAR _RocketHide4AfterBattleText3
- db "@"
-
-RocketHideout4Text4:
- TX_ASM
- ld hl, RocketHideout4TrainerHeader2
+ ld hl, RocketHideout4TrainerHeader0
call TalkToTrainer
jp TextScriptEnd
-RocketHideout4BattleText4:
+RocketHideout4Trainer0BeforeText:
TX_FAR _RocketHideout4BattleText4
db "@"
-RocketHideout4EndBattleText4:
+RocketHideout4Trainer0EndBattleText:
TX_FAR _RocketHideout4EndBattleText4
- db "@"
-
-RocketHideout4AfterBattleText4:
+ TX_BLINK
TX_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:
+ TX_ASM
+ ld hl, RocketHideout4Text_45844
+ call PrintText
+ jp TextScriptEnd
+
+RocketHideout4Text_45844:
TX_FAR _RocketHideout4Text_455ec
db "@"
diff --git a/scripts/Route1.asm b/scripts/Route1.asm
index e733b54d..d41360b2 100755
--- 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:
TX_ASM
- CheckAndSetEvent EVENT_GOT_POTION_SAMPLE
- jr nz, .asm_1cada
- ld hl, Route1ViridianMartSampleText
- call PrintText
- lb bc, POTION, 1
- call GiveItem
- jr nc, .BagFull
- ld hl, Route1Text_1cae8
- jr .asm_1cadd
-.BagFull
- ld hl, Route1Text_1caf3
- jr .asm_1cadd
-.asm_1cada
- ld hl, Route1Text_1caee
-.asm_1cadd
- call PrintText
+ callba Func_f1ad2
jp TextScriptEnd
-Route1ViridianMartSampleText:
- TX_FAR _Route1ViridianMartSampleText
- db "@"
-
-Route1Text_1cae8:
- TX_FAR _Route1Text_1cae8
- TX_SFX_ITEM_1
- db "@"
-
-Route1Text_1caee:
- TX_FAR _Route1Text_1caee
- db "@"
-
-Route1Text_1caf3:
- TX_FAR _Route1Text_1caf3
- db "@"
-
Route1Text2:
- TX_FAR _Route1Text2
- db "@"
+ TX_ASM
+ callba Func_f1b0f
+ jp TextScriptEnd
Route1Text3:
- TX_FAR _Route1Text3
- db "@"
+ TX_ASM
+ callba Func_f1b1b
+ jp TextScriptEnd
diff --git a/scripts/Route11Gate2F.asm b/scripts/Route11Gate2F.asm
index c140937d..fde7fdd6 100755
--- a/scripts/Route11Gate2F.asm
+++ b/scripts/Route11Gate2F.asm
@@ -9,7 +9,7 @@ Route11Gate2F_TextPointers:
Route11GateUpstairsText1:
TX_ASM
- xor a
+ ld a, $0
ld [wWhichTrade], a
predef DoInGameTradeDialogue
Route11GateUpstairsScriptEnd:
@@ -47,7 +47,7 @@ Route11GateUpstairsText_494a3:
Route11GateUpstairsText3:
TX_ASM
- ld a, [wSpriteStateData1 + 9]
+ ld a, [wSpritePlayerStateData1FacingDirection]
cp SPRITE_FACING_UP
jp nz, GateUpstairsScript_PrintIfFacingUp
CheckEvent EVENT_BEAT_ROUTE12_SNORLAX
diff --git a/scripts/Route12Gate2F.asm b/scripts/Route12Gate2F.asm
index 0cc2768b..4fe120e8 100755
--- a/scripts/Route12Gate2F.asm
+++ b/scripts/Route12Gate2F.asm
@@ -65,7 +65,7 @@ Route12GateUpstairsText_495c4:
db "@"
GateUpstairsScript_PrintIfFacingUp:
- ld a, [wSpriteStateData1 + 9]
+ ld a, [wSpritePlayerStateData1FacingDirection]
cp SPRITE_FACING_UP
jr z, .up
ld a, $1
diff --git a/scripts/Route19.asm b/scripts/Route19.asm
index 6f603e05..febeb9a4 100755
--- a/scripts/Route19.asm
+++ b/scripts/Route19.asm
@@ -36,7 +36,7 @@ Route19TrainerHeader0:
Route19TrainerHeader1:
dbEventFlagBit EVENT_BEAT_ROUTE_19_TRAINER_1
- db ($3 << 4) ; trainer's view range
+ db ($4 << 4) ; trainer's view range
dwEventFlagAddress EVENT_BEAT_ROUTE_19_TRAINER_1
dw Route19BattleText2 ; TextBeforeBattle
dw Route19AfterBattleText2 ; TextAfterBattle
@@ -120,60 +120,52 @@ Route19TrainerHeader9:
Route19Text1:
TX_ASM
ld hl, Route19TrainerHeader0
- call TalkToTrainer
- jp TextScriptEnd
+ jr Route19_TalkToTrainer
Route19Text2:
TX_ASM
ld hl, Route19TrainerHeader1
- call TalkToTrainer
- jp TextScriptEnd
+ jr Route19_TalkToTrainer
Route19Text3:
TX_ASM
ld hl, Route19TrainerHeader2
- call TalkToTrainer
- jp TextScriptEnd
+ jr Route19_TalkToTrainer
Route19Text4:
TX_ASM
ld hl, Route19TrainerHeader3
- call TalkToTrainer
- jp TextScriptEnd
+ jr Route19_TalkToTrainer
Route19Text5:
TX_ASM
ld hl, Route19TrainerHeader4
- call TalkToTrainer
- jp TextScriptEnd
+ jr Route19_TalkToTrainer
Route19Text6:
TX_ASM
ld hl, Route19TrainerHeader5
- call TalkToTrainer
- jp TextScriptEnd
+ jr Route19_TalkToTrainer
Route19Text7:
TX_ASM
ld hl, Route19TrainerHeader6
- call TalkToTrainer
- jp TextScriptEnd
+ jr Route19_TalkToTrainer
Route19Text8:
TX_ASM
ld hl, Route19TrainerHeader7
- call TalkToTrainer
- jp TextScriptEnd
+ jr Route19_TalkToTrainer
Route19Text9:
TX_ASM
ld hl, Route19TrainerHeader8
- call TalkToTrainer
- jp TextScriptEnd
+ jr Route19_TalkToTrainer
Route19Text10:
TX_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 100755
index 00000000..ee34ce55
--- /dev/null
+++ b/scripts/Route1_2.asm
@@ -0,0 +1,53 @@
+Func_f1ad2:
+ CheckAndSetEvent EVENT_GOT_POTION_SAMPLE
+ jr nz, .asm_1cada
+ ld hl, Route1ViridianMartSampleText
+ call PrintText
+ lb bc, POTION, 1
+ call GiveItem
+ jr nc, .BagFull
+ ld hl, Route1Text_f1aff
+ jr .asm_1cadd
+.BagFull
+ ld hl, Route1Text_f1b0a
+ jr .asm_1cadd
+.asm_1cada
+ ld hl, Route1Text_f1b05
+.asm_1cadd
+ call PrintText
+ ret
+
+Route1ViridianMartSampleText:
+ TX_FAR _Route1ViridianMartSampleText
+ db "@"
+
+Route1Text_f1aff:
+ TX_FAR _Route1Text_1cae8
+ TX_SFX_ITEM_1
+ db "@"
+
+Route1Text_f1b05:
+ TX_FAR _Route1Text_1caee
+ db "@"
+
+Route1Text_f1b0a:
+ TX_FAR _Route1Text_1caf3
+ db "@"
+
+Func_f1b0f:
+ ld hl, Route1Text_f1b16
+ call PrintText
+ ret
+
+Route1Text_f1b16:
+ TX_FAR _Route1Text2
+ db "@"
+
+Func_f1b1b:
+ ld hl, Route1Text_f1b22
+ call PrintText
+ ret
+
+Route1Text_f1b22:
+ TX_FAR _Route1Text3
+ db "@"
diff --git a/scripts/Route22.asm b/scripts/Route22.asm
index 7226e509..ff57f902 100755
--- a/scripts/Route22.asm
+++ b/scripts/Route22.asm
@@ -22,16 +22,17 @@ Route22Script7:
ret
Route22Script_50ed6:
+ ld a, OPP_SONY1
+ ld [wCurOpponent], a
+ ld a, $2
+ ld [wTrainerNo], a
+ ret
+
+Route22Script_50ee1:
+ ld a, OPP_SONY2
+ 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, $ff
- ld [wNewSoundID], a
- call PlaySound
+ call StopAllMusic
.asm_50f4e
ld c, BANK(Music_MeetRival)
ld a, MUSIC_MEET_RIVAL
@@ -131,25 +130,30 @@ Route22Script1:
ld hl, Route22RivalDefeatedText1
ld de, Route22Text_511bc
call SaveEndBattleTextPointers
- ld a, OPP_SONY1
- 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,$04
- db STARTER3,$05
- db STARTER1,$06
+Route22RivalDefeatedText1:
+ TX_FAR _Route22RivalDefeatedText1
+ db "@"
+
+Route22Text_511bc:
+ TX_FAR _Route22Text_511bc
+ db "@"
Route22Script2:
ld a, [wIsInBattle]
cp $ff
jp z, Route22Script_50ece
- ld a, [wSpriteStateData1 + 9]
+ ld a, [wRivalStarter]
+ cp 2
+ jr nz, .asm_50fc9
+ ld a, $1
+ ld [wRivalStarter], a
+.asm_50fc9
+ ld a, [wSpritePlayerStateData1FacingDirection]
and a ; cp SPRITE_FACING_DOWN
jr nz, .notDown
ld a, SPRITE_FACING_UP
@@ -167,9 +171,7 @@ Route22Script2:
ld a, $1
ld [hSpriteIndexOrTextID], a
call DisplayTextID
- ld a, $ff
- ld [wNewSoundID], a
- call PlaySound
+ call StopAllMusic
callba Music_RivalAlternateStart
ld a, [wcf0d]
cp $1
@@ -241,13 +243,9 @@ Route22Script_5104e:
ld a, [wWalkBikeSurfState]
and a
jr z, .skipYVisibilityTesta
- ld a, $ff
- ld [wNewSoundID], a
- call PlaySound
+ call StopAllMusic
.skipYVisibilityTesta
- ld a, $ff
- ld [wNewSoundID], a
- call PlaySound
+ call StopAllMusic
callba Music_RivalAlternateTempo
ld a, $2
ld [H_SPRITEINDEX], a
@@ -287,18 +285,18 @@ Route22Script4:
ld hl, Route22RivalDefeatedText2
ld de, Route22Text_511d0
call SaveEndBattleTextPointers
- ld a, OPP_SONY2
- ld [wCurOpponent], a
- ld hl, StarterMons_510d9
- call Route22Script_50ed6
+ call Route22Script_50ee1
ld a, $5
ld [wRoute22CurScript], a
ret
-StarterMons_510d9:
- db STARTER2,$0a
- db STARTER3,$0b
- db STARTER1,$0c
+Route22RivalDefeatedText2:
+ TX_FAR _Route22RivalDefeatedText2
+ db "@"
+
+Route22Text_511d0:
+ TX_FAR _Route22Text_511d0
+ db "@"
Route22Script5:
ld a, [wIsInBattle]
@@ -326,9 +324,7 @@ Route22Script5:
ld a, $2
ld [hSpriteIndexOrTextID], a
call DisplayTextID
- ld a, $ff
- ld [wNewSoundID], a
- call PlaySound
+ call StopAllMusic
callba Music_RivalAlternateStartAndTempo
ld a, [wcf0d]
cp $1
@@ -384,62 +380,15 @@ Route22_TextPointers:
Route22Text1:
TX_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
+ callba Func_f1b27
jp TextScriptEnd
Route22Text2:
TX_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
+ callba Func_f1b47
jp TextScriptEnd
-Route22RivalBeforeBattleText1:
- TX_FAR _Route22RivalBeforeBattleText1
- db "@"
-
-Route22RivalAfterBattleText1:
- TX_FAR _Route22RivalAfterBattleText1
- db "@"
-
-Route22RivalDefeatedText1:
- TX_FAR _Route22RivalDefeatedText1
- db "@"
-
-Route22Text_511bc:
- TX_FAR _Route22Text_511bc
- db "@"
-
-Route22RivalBeforeBattleText2:
- TX_FAR _Route22RivalBeforeBattleText2
- db "@"
-
-Route22RivalAfterBattleText2:
- TX_FAR _Route22RivalAfterBattleText2
- db "@"
-
-Route22RivalDefeatedText2:
- TX_FAR _Route22RivalDefeatedText2
- db "@"
-
-Route22Text_511d0:
- TX_FAR _Route22Text_511d0
- db "@"
-
Route22FrontGateText:
- TX_FAR _Route22FrontGateText
- db "@"
+ TX_ASM
+ callba Func_f1b67
+ jp TextScriptEnd
diff --git a/scripts/Route22Gate.asm b/scripts/Route22Gate.asm
index 86b1220d..946366b5 100755
--- a/scripts/Route22Gate.asm
+++ b/scripts/Route22Gate.asm
@@ -23,9 +23,12 @@ Route22GateScript0:
ret nc
xor a
ld [hJoyHeld], a
+ ld a, SPRITE_FACING_LEFT
+ ld [wSpriteStateData1 + 1 * $10 + 9], a
ld a, $1
ld [hSpriteIndexOrTextID], a
- jp DisplayTextID
+ call DisplayTextID
+ ret
Route22GateScriptCoords:
db 2,4
@@ -37,7 +40,7 @@ Route22GateScript_1e6ba:
ld [wSimulatedJoypadStatesIndex], a
ld a, D_DOWN
ld [wSimulatedJoypadStatesEnd], a
- ld [wSpriteStateData1 + 9], a
+ ld [wSpritePlayerStateData1FacingDirection], a
ld [wJoyIgnore], a
jp StartSimulatingJoypadStates
@@ -59,7 +62,7 @@ Route22Gate_TextPointers:
Route22GateText1:
TX_ASM
ld a, [wObtainedBadges]
- bit 0, a
+ bit 0, a ; BOULDERBADGE
jr nz, .asm_1e6f6
ld hl, Route22GateText_1e704
call PrintText
diff --git a/scripts/Route22_2.asm b/scripts/Route22_2.asm
new file mode 100755
index 00000000..1cd23ed2
--- /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:
+ TX_FAR _Route22RivalBeforeBattleText1
+ db "@"
+
+Route22RivalAfterBattleText1:
+ TX_FAR _Route22RivalAfterBattleText1
+ db "@"
+
+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:
+ TX_FAR _Route22RivalBeforeBattleText2
+ db "@"
+
+Route22RivalAfterBattleText2:
+ TX_FAR _Route22RivalAfterBattleText2
+ db "@"
+
+Func_f1b67:
+ ld hl, Route22FrontGateText_3c
+ call PrintText
+ ret
+
+Route22FrontGateText_3c:
+ TX_FAR _Route22FrontGateText
+ db "@"
diff --git a/scripts/Route23.asm b/scripts/Route23.asm
index e91e2c98..34d95b84 100755
--- a/scripts/Route23.asm
+++ b/scripts/Route23.asm
@@ -118,7 +118,7 @@ Route23Script_512d8:
ld a, D_DOWN
ld [wSimulatedJoypadStatesEnd], a
xor a
- ld [wSpriteStateData1 + 9], a
+ ld [wSpritePlayerStateData1FacingDirection], a
ld [wJoyIgnore], a
jp StartSimulatingJoypadStates
diff --git a/scripts/Route24.asm b/scripts/Route24.asm
index a8e16e7d..58f71981 100755
--- a/scripts/Route24.asm
+++ b/scripts/Route24.asm
@@ -84,6 +84,7 @@ Route24_TextPointers:
dw Route24Text6
dw Route24Text7
dw PickUpItemText
+ dw Route24Text8
Route24TrainerHeader0:
dbEventFlagBit EVENT_BEAT_ROUTE_24_TRAINER_0
@@ -190,7 +191,7 @@ Route24Text_51510:
Route24Text_5151a:
TX_FAR _Route24Text_5151a
- TX_SFX_ITEM_1
+ TX_SFX_KEY_ITEM
TX_BLINK
db "@"
@@ -317,3 +318,60 @@ Route24EndBattleText6:
Route24AfterBattleText6:
TX_FAR _Route24AfterBattleText6
db "@"
+
+Route24Text8:
+ TX_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:
+ TX_FAR _Route24DamianText1
+ db "@"
+
+Route24Text_515e3:
+ TX_FAR _Route24DamianText2
+ db $d
+ db "@"
+
+Route24Text_515e9:
+ TX_FAR _Route24DamianText3
+ db "@"
+
+Route24Text_515ee:
+ TX_FAR _Route24DamianText4
+ db "@"
+
diff --git a/scripts/Route25.asm b/scripts/Route25.asm
index 7166919d..c3c11ed5 100755
--- a/scripts/Route25.asm
+++ b/scripts/Route25.asm
@@ -1,14 +1,21 @@
Route25_Script:
- call Route25Script_515e1
call EnableAutoTextBoxDrawing
ld hl, Route25TrainerHeader0
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,16 @@ 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 +42,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 9f43b800..6ee3f317 100755
--- a/scripts/Route6.asm
+++ b/scripts/Route6.asm
@@ -35,7 +35,7 @@ Route6TrainerHeader1:
db ($0 << 4) ; trainer's view range
dwEventFlagAddress EVENT_BEAT_ROUTE_6_TRAINER_1
dw Route6BattleText2 ; TextBeforeBattle
- dw Route6AfterBattleText1 ; TextAfterBattle
+ dw Route6AfterBattleText2 ; TextAfterBattle
dw Route6EndBattleText2 ; TextEndBattle
dw Route6EndBattleText2 ; TextEndBattle
@@ -109,6 +109,10 @@ Route6EndBattleText2:
TX_FAR _Route6EndBattleText2
db "@"
+Route6AfterBattleText2:
+ TX_FAR _Route6AfterBattleText2
+ db "@"
+
Route6Text3:
TX_ASM
ld hl, Route6TrainerHeader2
diff --git a/scripts/Route7.asm b/scripts/Route7.asm
index 55774553..27d07a7a 100755
--- 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 8ecea68e..49f605a2 100755
--- 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
ld [hJoyHeld], a
diff --git a/scripts/Route9.asm b/scripts/Route9.asm
index a18096f0..8b346ee8 100755
--- 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
@@ -38,10 +38,10 @@ Route9TrainerHeader1:
dbEventFlagBit EVENT_BEAT_ROUTE_9_TRAINER_1
db ($2 << 4) ; trainer's view range
dwEventFlagAddress EVENT_BEAT_ROUTE_9_TRAINER_1
- dw Route9BattleText2 ; TextBeforeBattle
- dw Route9AfterBattleText2 ; TextAfterBattle
- dw Route9EndBattleText2 ; TextEndBattle
- dw Route9EndBattleText2 ; TextEndBattle
+ dw Route9BattleTextAJ ; TextBeforeBattle
+ dw Route9AfterBattleTextAJ ; TextAfterBattle
+ dw Route9EndBattleTextAJ ; TextEndBattle
+ dw Route9EndBattleTextAJ ; TextEndBattle
Route9TrainerHeader2:
dbEventFlagBit EVENT_BEAT_ROUTE_9_TRAINER_2
@@ -113,7 +113,7 @@ Route9Text1:
ld hl, Route9TrainerHeader0
jr Route9TalkToTrainer
-Route9Text2:
+Route9TextAJ:
TX_ASM
ld hl, Route9TrainerHeader1
jr Route9TalkToTrainer
@@ -167,16 +167,16 @@ Route9AfterBattleText1:
TX_FAR _Route9AfterBattleText1
db "@"
-Route9BattleText2:
- TX_FAR _Route9BattleText2
+Route9BattleTextAJ:
+ TX_FAR _Route9BattleTextAJ
db "@"
-Route9EndBattleText2:
- TX_FAR _Route9EndBattleText2
+Route9EndBattleTextAJ:
+ TX_FAR _Route9EndBattleTextAJ
db "@"
-Route9AfterBattleText2:
- TX_FAR _Route9AfterBattleText2
+Route9AfterBattleTextAJ:
+ TX_FAR _Route9AfterBattleTextAJ
db "@"
Route9BattleText3:
diff --git a/scripts/SSAnne2F.asm b/scripts/SSAnne2F.asm
index ba900748..77b283d2 100755
--- a/scripts/SSAnne2F.asm
+++ b/scripts/SSAnne2F.asm
@@ -24,9 +24,7 @@ SSAnne2Script0:
ld hl, CoordsData_61411
call ArePlayerCoordsInArray
ret nc
- ld a, $ff
- ld [wNewSoundID], a
- call PlaySound
+ call StopAllMusic
ld c, BANK(Music_MeetRival)
ld a, MUSIC_MEET_RIVAL
call PlayMusic
@@ -99,23 +97,8 @@ SSAnne2Script1:
call Delay3
ld a, OPP_SONY2
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
@@ -145,9 +128,7 @@ SSAnne2Script2:
ld a, $2
ld [H_SPRITEINDEX], a
call MoveSprite
- ld a, $ff
- ld [wNewSoundID], a
- call PlaySound
+ call StopAllMusic
callba Music_RivalAlternateStart
ld a, $3
ld [wSSAnne2FCurScript], a
diff --git a/scripts/SSAnne2FRooms.asm b/scripts/SSAnne2FRooms.asm
index a79e1be8..fb57cf37 100755
--- a/scripts/SSAnne2FRooms.asm
+++ b/scripts/SSAnne2FRooms.asm
@@ -1,8 +1,5 @@
SSAnne2FRooms_Script:
- ld a, $1
- ld [wAutoTextBoxDrawingControl], a
- xor a
- ld [wDoNotWaitForButtonPressAfterDisplayingText], a
+ call DisableAutoTextBoxDrawing
ld hl, SSAnne9TrainerHeader0
ld de, SSAnne2FRooms_ScriptPointers
ld a, [wSSAnne2FRoomsCurScript]
@@ -128,44 +125,24 @@ SSAnne9Text_61c10:
SSAnne9Text10:
TX_ASM
- ld hl, SSAnne9Text_61c1f
- call PrintText
+ callba Func_f2570
jp TextScriptEnd
-SSAnne9Text_61c1f:
- TX_FAR _SSAnne9Text_61c1f
- db "@"
-
SSAnne9Text11:
TX_ASM
- ld hl, SSAnne9Text_61c2e
- call PrintText
+ callba Func_f257c
jp TextScriptEnd
-SSAnne9Text_61c2e:
- TX_FAR _SSAnne9Text_61c2e
- db "@"
-
SSAnne9Text12:
TX_ASM
- ld hl, SSAnne9Text_61c3d
- call PrintText
+ callba Func_f2588
jp TextScriptEnd
-SSAnne9Text_61c3d:
- TX_FAR _SSAnne9Text_61c3d
- db "@"
-
SSAnne9Text13:
TX_ASM
- ld hl, SSAnne9Text_61c4c
- call PrintText
+ callba Func_f2594
jp TextScriptEnd
-SSAnne9Text_61c4c:
- TX_FAR _SSAnne9Text_61c4c
- db "@"
-
SSAnne9BattleText1:
TX_FAR _SSAnne9BattleText1
db "@"
diff --git a/scripts/SSAnne2FRooms_2.asm b/scripts/SSAnne2FRooms_2.asm
new file mode 100755
index 00000000..f856221c
--- /dev/null
+++ b/scripts/SSAnne2FRooms_2.asm
@@ -0,0 +1,35 @@
+Func_f2570:
+ ld hl, SSAnne9Text_f2577
+ call PrintText
+ ret
+
+SSAnne9Text_f2577:
+ TX_FAR _SSAnne9Text_61c1f
+ db "@"
+
+Func_f257c:
+ ld hl, SSAnne9Text_f2583
+ call PrintText
+ ret
+
+SSAnne9Text_f2583:
+ TX_FAR _SSAnne9Text_61c2e
+ db "@"
+
+Func_f2588:
+ ld hl, SSAnne9Text_f258f
+ call PrintText
+ ret
+
+SSAnne9Text_f258f:
+ TX_FAR _SSAnne9Text_61c3d
+ db "@"
+
+Func_f2594:
+ ld hl, SSAnne9Text_f259b
+ call PrintText
+ ret
+
+SSAnne9Text_f259b:
+ TX_FAR _SSAnne9Text_61c4c
+ db "@"
diff --git a/scripts/SSAnneCaptainsRoom.asm b/scripts/SSAnneCaptainsRoom.asm
index de0272e4..94918118 100755
--- 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 .asm_0faf5
.BagFull
ld hl, HM01NoRoomText
call PrintText
- ld hl, wd72d
- set 5, [hl]
jr .asm_0faf5
.asm_797c4
ld hl, SSAnne7Text_61932
@@ -45,13 +45,11 @@ SSAnne7RubText:
TX_FAR _SSAnne7RubText
TX_ASM
ld a, [wAudioROMBank]
- cp BANK(Audio3_UpdateMusic)
+ cp BANK(AudioEngine3)
ld [wAudioSavedROMBank], a
jr nz, .asm_61908
- ld a, $ff
- ld [wNewSoundID], a
- call PlaySound
- ld a, Bank(Music_PkmnHealed)
+ call StopAllMusic
+ ld a, BANK(Music_PkmnHealed)
ld [wAudioROMBank], a
.asm_61908
ld a, MUSIC_PKMN_HEALED
diff --git a/scripts/SafariZoneGate.asm b/scripts/SafariZoneGate.asm
index f3de556b..217001dd 100755
--- 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
@@ -25,7 +26,7 @@ SafariZoneGate_ScriptPointers:
xor a
ld [hJoyHeld], a
ld a, SPRITE_FACING_RIGHT
- ld [wSpriteStateData1 + 9], a
+ ld [wSpritePlayerStateData1FacingDirection], a
ld a, [wCoordIndex]
cp $1
jr z, .asm_7520f
@@ -43,8 +44,8 @@ SafariZoneGate_ScriptPointers:
ret
.CoordsData_75221:
- db $02,$03
- db $02,$04
+ db $02, $03
+ db $02, $04
db $FF
.SafariZoneEntranceScript1
@@ -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:
db "@"
.SafariZoneEntranceText4
- TX_FAR SafariZoneEntranceText_9e6e4
TX_ASM
- ld a, MONEY_BOX
- ld [wTextBoxID], a
- call DisplayTextBoxID
- call YesNoChoice
- ld a, [wCurrentMenuItem]
- and a
- jp nz, .PleaseComeAgain
- xor a
- ld [hMoney], a
- ld a, $05
- ld [hMoney + 1], a
- ld a, $00
- ld [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, 502 / $100
- ld [wSafariSteps], a
- ld a, 502 % $100
- 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
+ callab Func_f1f77
jp TextScriptEnd
-.MakePaymentText
- TX_FAR SafariZoneEntranceText_9e747
- TX_SFX_ITEM_1
- TX_FAR _SafariZoneEntranceText_75360
- db "@"
-
-.PleaseComeAgainText
- TX_FAR _SafariZoneEntranceText_75365
- db "@"
-
-.NotEnoughMoneyText
- TX_FAR _SafariZoneEntranceText_7536a
- db "@"
-
.SafariZoneEntranceText5
TX_FAR SafariZoneEntranceText_9e814
TX_ASM
@@ -231,7 +160,7 @@ SafariZoneGate_TextPointers:
ld hl, .SafariZoneEntranceText_753bb
call PrintText
xor a
- ld [wSpriteStateData1 + 9], a
+ ld [wSpritePlayerStateData1FacingDirection], a
ld a, D_DOWN
ld c, $3
call SafariZoneEntranceAutoWalk
@@ -243,7 +172,7 @@ SafariZoneGate_TextPointers:
ld hl, .SafariZoneEntranceText_753c0
call PrintText
ld a, SPRITE_FACING_UP
- ld [wSpriteStateData1 + 9], a
+ ld [wSpritePlayerStateData1FacingDirection], a
ld a, D_UP
ld c, $1
call SafariZoneEntranceAutoWalk
@@ -268,26 +197,5 @@ SafariZoneGate_TextPointers:
.SafariZoneEntranceText2
TX_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
+ callab Func_f203e
jp TextScriptEnd
-
-.FirstTimeQuestionText
- TX_FAR _SafariZoneEntranceText_753e6
- db "@"
-
-.ExplanationText
- TX_FAR _SafariZoneEntranceText_753eb
- db "@"
-
-.RegularText
- TX_FAR _SafariZoneEntranceText_753f0
- db "@"
diff --git a/scripts/SafariZoneGate2.asm b/scripts/SafariZoneGate2.asm
new file mode 100755
index 00000000..a99bad6a
--- /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
+ ld [hMoney], a
+ ld a, $5
+ ld [hMoney + 1], a
+ ld a, $0
+ ld [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
+ TX_FAR SafariZoneEntranceText_9e6e4
+ db "@"
+
+.MakePaymentText
+ TX_FAR SafariZoneEntranceText_9e747
+ TX_SFX_ITEM_1
+ TX_FAR _SafariZoneEntranceText_75360
+ db "@"
+
+.PleaseComeAgainText
+ TX_FAR _SafariZoneEntranceText_75365
+ db "@"
+
+.NotEnoughMoneyText
+ TX_FAR _SafariZoneEntranceText_7536a
+ db "@"
+
+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
+ TX_FAR _SafariZoneEntranceText_753e6
+ db "@"
+
+.ExplanationText
+ TX_FAR _SafariZoneEntranceText_753eb
+ db "@"
+
+.RegularText
+ TX_FAR _SafariZoneEntranceText_753f0
+ db "@"
+
+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
+ ld [hDivideBCDDivisor], a
+ ld [hDivideBCDDivisor + 1], a
+ ld a, 23
+ ld [hDivideBCDDivisor + 2], a
+ predef DivideBCDPredef3
+ ld 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:
+ TX_FAR _SafariZoneLowCostText1
+ db "@"
+
+SafariZoneEntranceText_f20c9:
+ TX_FAR _SafariZoneLowCostText2
+ db "@"
+
+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:
+ TX_FAR _SafariZoneLowCostText3
+ TX_SFX_ITEM_1
+ TX_FAR _SafariZoneLowCostText4
+ db "@"
+
+Pointers_f2100:
+ dw SafariZoneEntranceText_f210a
+ dw SafariZoneEntranceText_f210f
+ dw SafariZoneEntranceText_f2114
+ dw SafariZoneEntranceText_f2119
+ dw SafariZoneEntranceText_f2119
+
+SafariZoneEntranceText_f210a:
+ TX_FAR _SafariZoneLowCostText5
+ db "@"
+
+SafariZoneEntranceText_f210f:
+ TX_FAR _SafariZoneLowCostText6
+ db "@"
+
+SafariZoneEntranceText_f2114:
+ TX_FAR _SafariZoneLowCostText7
+ db "@"
+
+SafariZoneEntranceText_f2119:
+ TX_FAR _SafariZoneLowCostText8
+ db "@"
+
+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 a1d73628..435367ea 100755
--- a/scripts/SaffronPokecenter.asm
+++ b/scripts/SaffronPokecenter.asm
@@ -7,6 +7,7 @@ SaffronPokecenter_TextPointers:
dw SaffronPokecenterText2
dw SaffronPokecenterText3
dw SaffronTradeNurseText
+ dw SaffronPokecenterText5
SaffronHealNurseText:
TX_POKECENTER_NURSE
@@ -21,3 +22,8 @@ SaffronPokecenterText3:
SaffronTradeNurseText:
TX_CABLE_CLUB_RECEPTIONIST
+
+SaffronPokecenterText5:
+ TX_ASM
+ callab PokecenterChanseyText
+ jp TextScriptEnd
diff --git a/scripts/SeafoamIslandsB4F.asm b/scripts/SeafoamIslandsB4F.asm
index d08628d0..1383a561 100755
--- 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 483082a1..e58dbebe 100755
--- a/scripts/SilphCo11F.asm
+++ b/scripts/SilphCo11F.asm
@@ -1,5 +1,5 @@
SilphCo11F_Script:
- call SilphCo11Script_62110
+ call SilphCo11Script_62127
call EnableAutoTextBoxDrawing
ld hl, SilphCo11TrainerHeader0
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:
db $06,$03
db $FF
-SilphCo11Script_62137:
+SilphCo11Script_6214f:
push hl
ld hl, wCardKeyDoorY
ld a, [hli]
@@ -63,93 +64,17 @@ SilphCo11Script_62137:
ld [$ffe0], a
ret
-SilphCo11Script_62163:
+SilphCo11Script_6217b:
ld a, [$ffe0]
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 $ff
- 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 $FF
-
-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 $FF
-
-SilphCo11Script_621c4:
+SilphCo11Script_62185:
xor a
ld [wJoyIgnore], a
-
-SilphCo11Script_621c8:
+SilphCo11Script_62189:
ld [wSilphCo11FCurScript], a
ld [wCurMapScript], a
ret
@@ -161,10 +86,26 @@ 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
+ 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 +123,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:
db $0D,$06
@@ -196,18 +138,18 @@ MovementData_62216:
db NPC_MOVEMENT_DOWN
db $FF
-SilphCo11Script_6221a:
+SilphCo11Script_621ff:
ld [wPlayerMovingDirection], a
- ld a, $3
- ld [H_SPRITEINDEX], a
ld a, b
- ld [hSpriteFacingDirection], a
- jp SetSpriteFacingDirectionAndDelay
+ ld [wSpriteStateData1 + 3 * $10 + 9], a
+ ld a, $2
+ ld [wSpriteStateData1 + 3 * $10 + 1], 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 +160,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
ld [hSpriteIndexOrTextID], a
call DisplayTextID
call GBFadeOutToBlack
- call SilphCo11Script_6216d
+ callba 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 +193,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
ld a, [H_SPRITEINDEX]
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
+ ld [hJoyHeld], a
+ ld a, $fc
+ ld [wJoyIgnore], a
+ ld a, $1
+ ld [wDoNotWaitForButtonPressAfterDisplayingText], a
+ ld a, $8
+ ld [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
+ ld [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 [wSpriteStateData1 + 4 * $10 + 1], a
+ ld hl, wSpriteStateData1 + 4 * $10 + 9
+ 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
+ ld [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 [wSpriteStateData1 + 6 * $10 + 1], a
+ ld hl, wSpriteStateData1 + 6 * $10 + 9
+ 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
+ ld [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
+ ld [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 [wSpriteStateData1 + 4 * $10 + 1], a
+ ld [wSpriteStateData1 + 6 * $10 + 1], a
+ xor a
+ ld [wSpriteStateData1 + 4 * $10 + 9], a
+ ld [wSpriteStateData1 + 6 * $10 + 9], a
+ ld a, $fc
+ ld [wJoyIgnore], a
+ ld a, $1
+ ld [wDoNotWaitForButtonPressAfterDisplayingText], a
+ ld a, $a
+ ld [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
+ ld [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,64 +470,93 @@ SilphCo11F_TextPointers:
dw SilphCo11Text4
dw SilphCo11Text5
dw SilphCo11Text6
+ dw SilphCo11Text7
+ dw SilphCo11Text8
+ dw SilphCo11Text9
+ dw SilphCo11Text10
SilphCo11TrainerHeader0:
- dbEventFlagBit EVENT_BEAT_SILPH_CO_11F_TRAINER_0
- db ($4 << 4) ; trainer's view range
- dwEventFlagAddress EVENT_BEAT_SILPH_CO_11F_TRAINER_0
- dw SilphCo11BattleText1 ; TextBeforeBattle
- dw SilphCo11AfterBattleText1 ; TextAfterBattle
- dw SilphCo11EndBattleText1 ; TextEndBattle
- dw SilphCo11EndBattleText1 ; TextEndBattle
-
-SilphCo11TrainerHeader1:
dbEventFlagBit EVENT_BEAT_SILPH_CO_11F_TRAINER_1
- db ($3 << 4) ; trainer's view range
+ db ($3 << 4)
dwEventFlagAddress EVENT_BEAT_SILPH_CO_11F_TRAINER_1
- dw SilphCo11BattleText2 ; TextBeforeBattle
- dw SilphCo11AfterBattleText2 ; TextAfterBattle
- dw SilphCo11EndBattleText2 ; TextEndBattle
- dw SilphCo11EndBattleText2 ; TextEndBattle
+ dw SilphCo11Trainer1BattleText
+ dw SilphCo11Trainer1AfterBattleText
+ dw SilphCo11Trainer1EndBattleText
+ dw SilphCo11Trainer1EndBattleText
- db $ff
+ db $ff ; no more trainers
+
+SilphCo11Text4:
+SilphCo11Text6:
+SilphCo11Text8:
+ TX_FAR _SilphCoJessieJamesText1
+ TX_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:
+ TX_FAR _SilphCoJessieJamesText2
+ db "@"
+
+SilphCo11Text_624c2:
+ TX_FAR _SilphCoJessieJamesText3
+ db "@"
+
+SilphCo11Text10:
+ TX_FAR _SilphCoJessieJamesText4
+ TX_ASM
+ ld c, 64
+ call DelayFrames
+ jp TextScriptEnd
SilphCo11Text1:
TX_ASM
CheckEvent EVENT_GOT_MASTER_BALL
- jp nz, .asm_62308
- ld hl, SilphCoPresidentText
+ jp nz, .asm_62500
+ ld hl, SilphCo11Text_62509
call PrintText
lb bc, MASTER_BALL, 1
call GiveItem
- jr nc, .BagFull
- ld hl, ReceivedSilphCoMasterBallText
+ jr nc, .asm_624f8
+ ld hl, SilphCo11Text_6250e
call PrintText
SetEvent EVENT_GOT_MASTER_BALL
- jr .asm_6230e
-.BagFull
- ld hl, SilphCoMasterBallNoRoomText
+ jr .asm_62506
+.asm_624f8
+ ld hl, SilphCo11Text_62519
call PrintText
- jr .asm_6230e
-.asm_62308
- ld hl, SilphCo10Text_6231c
+ jr .asm_62506
+
+.asm_62500
+ ld hl, SilphCo11Text_62514
call PrintText
-.asm_6230e
+.asm_62506
jp TextScriptEnd
-SilphCoPresidentText:
+SilphCo11Text_62509:
TX_FAR _SilphCoPresidentText
db "@"
-ReceivedSilphCoMasterBallText:
+SilphCo11Text_6250e:
TX_FAR _ReceivedSilphCoMasterBallText
TX_SFX_KEY_ITEM
db "@"
-SilphCo10Text_6231c:
+SilphCo11Text_62514:
TX_FAR _SilphCo10Text_6231c
db "@"
-SilphCoMasterBallNoRoomText:
+SilphCo11Text_62519:
TX_FAR _SilphCoMasterBallNoRoomText
db "@"
@@ -348,58 +568,28 @@ SilphCo11Text3:
TX_FAR _SilphCo11Text3
db "@"
-SilphCo10Text_62330:
+SilphCo10Text_62528:
TX_FAR _SilphCo10Text_62330
db "@"
-SilphCo11Text6:
+SilphCo11Text7:
TX_FAR _SilphCo10Text_62335
db "@"
-SilphCo11Text4:
- TX_ASM
- ld hl, SilphCo11TrainerHeader0
- call TalkToTrainer
- jp TextScriptEnd
-
-SilphCo11BattleText1:
- TX_FAR _SilphCo11BattleText1
- db "@"
-
-SilphCo11EndBattleText1:
- TX_FAR _SilphCo11EndBattleText1
- db "@"
-
-SilphCo11AfterBattleText1:
- TX_FAR _SilphCo11AfterBattleText1
- db "@"
-
SilphCo11Text5:
TX_ASM
- ld hl, SilphCo11TrainerHeader1
+ ld hl, SilphCo11TrainerHeader0
call TalkToTrainer
jp TextScriptEnd
-SilphCo11BattleText2:
+SilphCo11Trainer1BattleText:
TX_FAR _SilphCo11BattleText2
db "@"
-SilphCo11EndBattleText2:
+SilphCo11Trainer1EndBattleText:
TX_FAR _SilphCo11EndBattleText2
db "@"
-SilphCo11AfterBattleText2:
+SilphCo11Trainer1AfterBattleText:
TX_FAR _SilphCo11AfterBattleText2
db "@"
-
-SilphCo10Text_6236c:
- TX_ASM
- ld hl, SilphCo10Text_6237b
- call PrintText
- ld a, PORYGON
- call DisplayPokedex
- jp TextScriptEnd
-
-SilphCo10Text_6237b:
- TX_FAR _SilphCo10Text_6237b
- db "@"
diff --git a/scripts/SilphCo11F_2.asm b/scripts/SilphCo11F_2.asm
new file mode 100755
index 00000000..bf575de5
--- /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 e7594663..a8dc032d 100755
--- 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, $ff
- 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_SONY2
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
ld [hSpriteIndexOrTextID], a
call DisplayTextID
- ld a, $ff
- ld [wNewSoundID], a
- call PlaySound
+ call StopAllMusic
callba Music_RivalAlternateStart
ld de, MovementData_51d1d
ld a, [wcf0d]
diff --git a/scripts/TradeCenter.asm b/scripts/TradeCenter.asm
index ddb3061e..ddb3061e 100755..100644
--- a/scripts/TradeCenter.asm
+++ b/scripts/TradeCenter.asm
diff --git a/scripts/VermilionCity.asm b/scripts/VermilionCity.asm
index b253fea6..a9336970 100755
--- 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
+ ld a, [hRandomAdd]
+ ld b, a
ld a, [hRandomSub]
+ adc b
and $e
ld [wFirstLockTrashCanIndex], a
ret
@@ -38,12 +53,12 @@ VermilionCity_ScriptPointers:
dw VermilionCityScript4
VermilionCityScript0:
- ld a, [wSpriteStateData1 + 9]
+ 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
ld [hJoyHeld], a
ld [wcf0d], a
@@ -67,6 +82,9 @@ VermilionCityScript0:
ld [wVermilionCityCurScript], a
ret
+.return
+ ret
+
SSAnneTicketCheckCoords:
db $1e,$12 ; y, x
db $ff
@@ -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:
TX_FAR _VermilionCityText1
@@ -157,7 +176,7 @@ VermilionCityText3:
TX_ASM
CheckEvent EVENT_SS_ANNE_LEFT
jr nz, .shipHasDeparted
- ld a, [wSpriteStateData1 + 9]
+ ld a, [wSpritePlayerStateData1FacingDirection]
cp SPRITE_FACING_RIGHT
jr z, .greetPlayer
ld hl, .inFrontOfOrBehindGuardCoords
@@ -225,33 +244,43 @@ VermilionCityText5:
ld a, MACHOP
call PlayCry
call WaitForSoundToFinish
- ld hl, VermilionCityText14
+ ld hl, VermilionCityText15
ret
-VermilionCityText14:
- TX_FAR _VermilionCityText14
+VermilionCityText15:
+ TX_FAR _VermilionCityText15
db "@"
VermilionCityText6:
TX_FAR _VermilionCityText6
db "@"
-VermilionCityText7:
- TX_FAR _VermilionCityText7
- db "@"
-
VermilionCityText8:
- TX_FAR _VermilionCityText8
- db "@"
+ TX_ASM
+ callba Func_f1a8a
+ jp TextScriptEnd
-VermilionCityText11:
- TX_FAR _VermilionCityText11
- db "@"
+VermilionCityText9:
+ TX_ASM
+ callba Func_f1a96
+ jp TextScriptEnd
VermilionCityText12:
- TX_FAR _VermilionCityText12
- db "@"
+ TX_ASM
+ callba Func_f1aa2
+ jp TextScriptEnd
VermilionCityText13:
- TX_FAR _VermilionCityText13
- db "@"
+ TX_ASM
+ callba Func_f1aae
+ jp TextScriptEnd
+
+VermilionCityText14:
+ TX_ASM
+ callba Func_f1aba
+ jp TextScriptEnd
+
+VermilionCityText7:
+ TX_ASM
+ callba Func_f1a0f
+ jp TextScriptEnd
diff --git a/scripts/VermilionCity2.asm b/scripts/VermilionCity2.asm
new file mode 100755
index 00000000..eb7ea37a
--- /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:
+ TX_FAR _OfficerJennyText1
+ db "@"
+
+OfficerJennyText2:
+ TX_FAR _OfficerJennyText2
+ db "@"
+
+OfficerJennyText3:
+ TX_FAR _OfficerJennyText3
+ db $d
+ db "@"
+
+OfficerJennyText4:
+ TX_FAR _OfficerJennyText4
+ db "@"
+
+OfficerJennyText5:
+ TX_FAR _OfficerJennyText5
+ db "@"
+
+Func_f1a8a:
+ ld hl, VermilionCityText_f1a91
+ call PrintText
+ ret
+
+VermilionCityText_f1a91:
+ TX_FAR _VermilionCityText8
+ db "@"
+
+Func_f1a96:
+ ld hl, VermilionCityText_f1a9d
+ call PrintText
+ ret
+
+VermilionCityText_f1a9d:
+ TX_FAR _VermilionCityText9
+ db "@"
+
+Func_f1aa2:
+ ld hl, VermilionCityText_f1aa9
+ call PrintText
+ ret
+
+VermilionCityText_f1aa9:
+ TX_FAR _VermilionCityText12
+ db "@"
+
+Func_f1aae:
+ ld hl, VermilionCityText_f1ab5
+ call PrintText
+ ret
+
+VermilionCityText_f1ab5:
+ TX_FAR _VermilionCityText13
+ db "@"
+
+Func_f1aba:
+ ld hl, VermilionCityText_f1ac1
+ call PrintText
+ ret
+
+VermilionCityText_f1ac1:
+ TX_FAR _VermilionCityText14
+ db "@"
diff --git a/scripts/VermilionDock.asm b/scripts/VermilionDock.asm
index 65b66c52..f5807dd4 100755
--- a/scripts/VermilionDock.asm
+++ b/scripts/VermilionDock.asm
@@ -40,8 +40,7 @@ VermilionDock_1db9b:
SetEventForceReuseHL EVENT_SS_ANNE_LEFT
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:
ld [H_AUTOBGTRANSFERENABLED], a
ld [wSSAnneSmokeDriftAmount], a
ld [rOBP1], a
+ call UpdateGBCPal_OBP1
ld a, 88
ld [wSSAnneSmokeX], a
ld hl, wMapViewVRAMPointer
@@ -124,7 +124,7 @@ VermilionDock_1db9b:
VermilionDock_AnimSmokePuffDriftRight:
push bc
push de
- ld hl, wOAMBuffer + $11
+ ld hl, wOAMBuffer + 4 * $4 + 1 ; x coord
ld a, [wSSAnneSmokeDriftAmount]
swap a
ld c, a
diff --git a/scripts/VermilionPokecenter.asm b/scripts/VermilionPokecenter.asm
index 60b28c57..e470b028 100755
--- a/scripts/VermilionPokecenter.asm
+++ b/scripts/VermilionPokecenter.asm
@@ -7,6 +7,7 @@ VermilionPokecenter_TextPointers:
dw VermilionPokecenterText2
dw VermilionPokecenterText3
dw VermilionTradeNurseText
+ dw VermilionPokecenterText5
VermilionHealNurseText:
TX_POKECENTER_NURSE
@@ -21,3 +22,8 @@ VermilionPokecenterText3:
VermilionTradeNurseText:
TX_CABLE_CLUB_RECEPTIONIST
+
+VermilionPokecenterText5:
+ TX_ASM
+ callab PokecenterChanseyText
+ jp TextScriptEnd
diff --git a/scripts/VermilionTradeHouse.asm b/scripts/VermilionTradeHouse.asm
index 828e3716..7f720364 100755
--- a/scripts/VermilionTradeHouse.asm
+++ b/scripts/VermilionTradeHouse.asm
@@ -5,8 +5,5 @@ VermilionTradeHouse_TextPointers:
dw VermilionHouse3Text1
VermilionHouse3Text1:
- TX_ASM
- ld a, $4
- ld [wWhichTrade], a
- predef DoInGameTradeDialogue
- jp TextScriptEnd
+ TX_FAR TeachingHMsText
+ db "@"
diff --git a/scripts/VictoryRoad1F.asm b/scripts/VictoryRoad1F.asm
index 0a2588a7..07f203b1 100755
--- a/scripts/VictoryRoad1F.asm
+++ b/scripts/VictoryRoad1F.asm
@@ -29,6 +29,9 @@ VictoryRoad1Script0:
ld hl, CoordsData_5da5c
call CheckBoulderCoords
jp nc, CheckFightingMapTrainers
+ ld a, [H_SPRITEINDEX]
+ 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 9dfb05ed..a09e6f04 100755
--- a/scripts/VictoryRoad2F.asm
+++ b/scripts/VictoryRoad2F.asm
@@ -17,7 +17,6 @@ VictoryRoad2F_Script:
VictoryRoad2Script_517c4:
ResetEvent EVENT_VICTORY_ROAD_1_BOULDER_ON_SWITCH
-
VictoryRoad2Script_517c9:
CheckEvent EVENT_VICTORY_ROAD_2_BOULDER_ON_SWITCH1
jr z, .asm_517da
@@ -31,7 +30,6 @@ VictoryRoad2Script_517c9:
ret z
ld a, $1d
lb bc, 7, 11
-
VictoryRoad2Script_517e2:
ld [wNewTileBlockID], a
predef ReplaceTileBlock
@@ -46,6 +44,9 @@ VictoryRoad2Script0:
ld hl, CoordsData_51816
call CheckBoulderCoords
jp nc, CheckFightingMapTrainers
+ ld a, [hSpriteIndexOrTextID]
+ cp $f
+ jp z, CheckFightingMapTrainers
EventFlagAddress hl, EVENT_VICTORY_ROAD_2_BOULDER_ON_SWITCH1
ld a, [wCoordIndex]
cp $2
@@ -132,10 +133,10 @@ MoltresTrainerHeader:
dbEventFlagBit EVENT_BEAT_MOLTRES
db ($0 << 4) ; trainer's view range
dwEventFlagAddress EVENT_BEAT_MOLTRES
- dw MoltresBattleText ; TextBeforeBattle
- dw MoltresBattleText ; TextAfterBattle
- dw MoltresBattleText ; TextEndBattle
- dw MoltresBattleText ; TextEndBattle
+ dw MoltresBattleText ; TextBeforeBattle
+ dw MoltresBattleText ; TextAfterBattle
+ dw MoltresBattleText ; TextEndBattle
+ dw MoltresBattleText ; TextEndBattle
db $ff
diff --git a/scripts/VictoryRoad3F.asm b/scripts/VictoryRoad3F.asm
index d145c4a1..dc7a2aac 100755
--- a/scripts/VictoryRoad3F.asm
+++ b/scripts/VictoryRoad3F.asm
@@ -36,6 +36,9 @@ VictoryRoad3Script0:
ld a, [wCoordIndex]
cp $1
jr nz, .asm_449dc
+ ld 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 643431a4..6dc68d4f 100755
--- 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]
@@ -24,304 +39,325 @@ ViridianCityScript_1900b:
ret
.gymClosed
ld a, [wYCoord]
- cp $8
+ cp 8
ret nz
ld a, [wXCoord]
- cp $20
+ cp 32
ret nz
- ld a, $e
+ ld a, $f
ld [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
ld [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
+ cp 9
ret nz
ld a, [wXCoord]
- cp $13
+ cp 19
ret nz
ld a, $5
ld [hSpriteIndexOrTextID], a
call DisplayTextID
xor a
ld [hJoyHeld], a
- call ViridianCityScript_190cf
- ld a, $3
+ call ViridianCityScript_1914d
+ ld a, $5
ld [wViridianCityCurScript], a
ret
-ViridianCityScript1:
- ld a, [wSpriteStateData1 + $34]
- ld [$ffeb], a
- ld a, [wSpriteStateData1 + $36]
- ld [$ffec], a
- ld a, [wSpriteStateData2 + $34]
- ld [$ffed], a
- ld a, [wSpriteStateData2 + $35]
- ld [$ffee], a
+ViridianCityScript3:
+ call ViridianCityScript_190ef
+ call ViridianCityScript_190db
+ ResetEvent EVENT_02F
+ ld a, $4
+ ld [wViridianCityCurScript], a
+ ret
+
+ViridianCityScript_190db:
xor a
ld [wListScrollOffset], a
-
- ; set up battle for Old Man
ld a, BATTLE_TYPE_OLD_MAN
ld [wBattleType], a
ld a, 5
ld [wCurEnemyLVL], a
- ld a, WEEDLE
+ ld a, RATTATA
ld [wCurOpponent], a
- ld a, $2
- ld [wViridianCityCurScript], a
ret
-ViridianCityScript2:
- ld a, [$ffeb]
- ld [wSpriteStateData1 + $34], a
- ld a, [$ffec]
- ld [wSpriteStateData1 + $36], a
- ld a, [$ffed]
- ld [wSpriteStateData2 + $34], a
- ld a, [$ffee]
- ld [wSpriteStateData2 + $35], a
+ViridianCityScript_190ef:
+ ld a, [wSpriteStateData1 + 3 * $10 + 4]
+ ld [$ffeb], a
+ ld a, [wSpriteStateData1 + 3 * $10 + 6]
+ ld [$ffec], a
+ ld a, [wSpriteStateData2 + 3 * $10 + 4]
+ ld [$ffed], a
+ ld a, [wSpriteStateData2 + 3 * $10 + 5]
+ ld [$ffee], a
+ ret
+
+ViridianCityScript4:
+ call ViridianCityScript_1912a
call UpdateSprites
call Delay3
+ SetEvent EVENT_02E
xor a
ld [wJoyIgnore], a
- ld a, $f
+ ld a, $10
ld [hSpriteIndexOrTextID], a
call DisplayTextID
xor a
ld [wBattleType], a
ld [wJoyIgnore], a
- ld a, $0
+ ld a, $2
ld [wViridianCityCurScript], a
ret
-ViridianCityScript3:
+ViridianCityScript_1912a:
+ ld a, [$ffeb]
+ ld [wSpriteStateData1 + 3 * $10 + 4], a
+ ld a, [$ffec]
+ ld [wSpriteStateData1 + 3 * $10 + 6], a
+ ld a, [$ffed]
+ ld [wSpriteStateData2 + 3 * $10 + 4], a
+ ld a, [$ffee]
+ ld [wSpriteStateData2 + 3 * $10 + 5], a
+ ret
+
+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
ld a, D_DOWN
ld [wSimulatedJoypadStatesEnd], a
xor a
- ld [wSpriteStateData1 + 9], a
+ ld [wSpritePlayerStateData1FacingDirection], a
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
+ ld [hSpriteIndexOrTextID], a
+ ld a, SPRITE_FACING_RIGHT
+ ld [hSpriteFacingDirection], a
+ call SetSpriteFacingDirectionAndDelay
+ ld a, $8
+ ld [wSpritePlayerStateData1FacingDirection], a
+ ld a, $8
+ ld [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
+ ld [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
+ callab Func_f1a01
+ ld de, ViridianCityOldManMovementData1
+.asm_191e4
+ ld a, $8
+ ld [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
-
-ViridianCityText1:
- TX_FAR _ViridianCityText1
- db "@"
+ dw ViridianCityText_11
+ dw ViridianCityText_12
+ dw ViridianCityText_13
-ViridianCityText2:
+ViridianCityText_0:
TX_ASM
- ld a, [wObtainedBadges]
- cp %01111111
- ld hl, ViridianCityText_19127
- jr z, .printAndDone
- CheckEvent EVENT_BEAT_VIRIDIAN_GYM_GIOVANNI
- jr nz, .printAndDone
- ld hl, ViridianCityText_19122
-.printAndDone
- call PrintText
+ callba Func_f18bb
jp TextScriptEnd
-ViridianCityText_19122:
- TX_FAR _ViridianCityText_19122
- db "@"
-
-ViridianCityText_19127:
- TX_FAR _ViridianCityText_19127
- db "@"
-
-ViridianCityText3:
+ViridianCityText_1:
TX_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
+ callba Func_f18c7
jp TextScriptEnd
-ViridianCityText_1914d:
- TX_FAR _ViridianCityText_1914d
- db "@"
-
-ViridianCityText_19152:
- TX_FAR _ViridianCityText_19152
- db "@"
-
-ViridianCityText_19157:
- TX_FAR _ViridianCityText_19157
- db "@"
-
-ViridianCityText4:
+ViridianCityText_2:
TX_ASM
- CheckEvent EVENT_GOT_POKEDEX
- jr nz, .gotPokedex
- ld hl, ViridianCityText_19175
- call PrintText
- jr .done
-.gotPokedex
- ld hl, ViridianCityText_1917a
- call PrintText
-.done
+ callba Func_f18e9
jp TextScriptEnd
-ViridianCityText_19175:
- TX_FAR _ViridianCityText_19175
- db "@"
-
-ViridianCityText_1917a:
- TX_FAR _ViridianCityText_1917a
- db "@"
-
-ViridianCityText5:
+ViridianCityText_3:
TX_ASM
- ld hl, ViridianCityText_19191
- call PrintText
- call ViridianCityScript_190cf
- ld a, $3
- ld [wViridianCityCurScript], a
+ callba Func_f1911
jp TextScriptEnd
-ViridianCityText_19191:
- TX_FAR _ViridianCityText_19191
- db "@"
-
-ViridianCityText6:
+ViridianCityText_4:
TX_ASM
- CheckEvent EVENT_GOT_TM42
- jr nz, .gotTm42
- ld hl, ViridianCityText_191ca
- call PrintText
- lb bc, TM_42, 1
- call GiveItem
- jr nc, .BagFull
- ld hl, ReceivedTM42Text
- call PrintText
- SetEvent EVENT_GOT_TM42
- jr .done
-.BagFull
- ld hl, TM42NoRoomText
- call PrintText
- jr .done
-.gotTm42
- ld hl, TM42Explanation
- call PrintText
-.done
+ callba Func_f192c
jp TextScriptEnd
-ViridianCityText_191ca:
- TX_FAR _ViridianCityText_191ca
- db "@"
-
-ReceivedTM42Text:
- TX_FAR _ReceivedTM42Text
- TX_SFX_ITEM_2
- db "@"
+ViridianCityText_5:
+ TX_ASM
+ callba Func_f194a
+ jp TextScriptEnd
-TM42Explanation:
- TX_FAR _TM42Explanation
- db "@"
+ViridianCityText_6:
+ TX_ASM
+ callba Func_f198e
+ jp TextScriptEnd
-TM42NoRoomText:
- TX_FAR _TM42NoRoomText
+ViridianCityText_13:
+ TX_FAR _ViridianCityText_19219
db "@"
-ViridianCityText7:
+ViridianCityText_7:
TX_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, .hurry
- ld hl, ViridianCityText_1920f
- call PrintText
- ld a, $1
+ ld a, $7
ld [wViridianCityCurScript], a
- jr .done
-.hurry
- ld hl, ViridianCityText_19214
+ jr .asm_192ac
+
+.asm_192a6
+ ld hl, ViridianCityText_192b4
call PrintText
-.done
+.asm_192ac
jp TextScriptEnd
-ViridianCityText_1920a:
+ViridianCityText_192af:
TX_FAR _ViridianCityText_1920a
db "@"
-ViridianCityText_1920f:
- TX_FAR _ViridianCityText_1920f
+ViridianCityText_192b4:
+ TX_FAR _OldManTextAfterBattle
db "@"
-ViridianCityText_19214:
- TX_FAR _ViridianCityText_19214
- db "@"
-
-ViridianCityText15:
- TX_FAR _ViridianCityText_19219
- db "@"
-
-ViridianCityText8:
- TX_FAR _ViridianCityText8
- db "@"
+ViridianCityText_8:
+ TX_ASM
+ callba Func_f19c5
+ jp TextScriptEnd
-ViridianCityText9:
- TX_FAR _ViridianCityText9
- db "@"
+ViridianCityText_9:
+ TX_ASM
+ callba Func_f19d1
+ jp TextScriptEnd
-ViridianCityText10:
- TX_FAR _ViridianCityText10
- db "@"
+ViridianCityText_10:
+ TX_ASM
+ callba Func_f19dd
+ jp TextScriptEnd
-ViridianCityText13:
- TX_FAR _ViridianCityText13
- db "@"
+ViridianCityText_11:
+ TX_ASM
+ callba Func_f19e9
+ jp TextScriptEnd
-ViridianCityText14:
- TX_FAR _ViridianCityText14
- db "@"
+ViridianCityText_12:
+ TX_ASM
+ callba Func_f19f5
+ jp TextScriptEnd
diff --git a/scripts/ViridianCity2.asm b/scripts/ViridianCity2.asm
new file mode 100755
index 00000000..ffaeb4e2
--- /dev/null
+++ b/scripts/ViridianCity2.asm
@@ -0,0 +1,215 @@
+Func_f18bb:
+ ld hl, ViridianCityText_f18c2
+ call PrintText
+ ret
+
+ViridianCityText_f18c2:
+ TX_FAR _ViridianCityText1
+ db "@"
+
+Func_f18c7:
+ ld hl, ViridianCityText_f18e4
+ ld a, [wObtainedBadges]
+ cp %01111111
+ jr z, .printAndDone
+ CheckEvent EVENT_BEAT_VIRIDIAN_GYM_GIOVANNI
+ jr nz, .printAndDone
+ ld hl, ViridianCityText_f18df
+.printAndDone
+ call PrintText
+ ret
+
+ViridianCityText_f18df:
+ TX_FAR _ViridianCityText_19122
+ db "@"
+
+ViridianCityText_f18e4:
+ TX_FAR _ViridianCityText_19127
+ db "@"
+
+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:
+ TX_FAR _ViridianCityText_1914d
+ db "@"
+
+ViridianCityText_f1907:
+ TX_FAR _ViridianCityText_19152
+ db "@"
+
+ViridianCityText_f190c:
+ TX_FAR _ViridianCityText_19157
+ db "@"
+
+Func_f1911:
+ ld hl, ViridianCityText_f1927
+ CheckEvent EVENT_GOT_POKEDEX
+ jr nz, .gotPokedex
+ ld hl, ViridianCityText_f1922
+.gotPokedex
+ call PrintText
+ ret
+
+ViridianCityText_f1922:
+ TX_FAR _ViridianCityText_19175
+ db "@"
+
+ViridianCityText_f1927:
+ TX_FAR _ViridianCityText_1917a
+ db "@"
+
+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:
+ TX_FAR _ViridianCityText_19191
+ db "@"
+
+Func_f194a:
+ CheckEvent EVENT_GOT_TM42
+ jr nz, .gotTm42
+ ld hl, ViridianCityText_f1979
+ call PrintText
+ lb bc, TM_42, 1
+ call GiveItem
+ jr nc, .BagFull
+ ld hl, ViridianCityText_f197e
+ call PrintText
+ SetEvent EVENT_GOT_TM42
+ ret
+.BagFull
+ ld hl, ViridianCityText_f1989
+ call PrintText
+ ret
+.gotTm42
+ ld hl, ViridianCityText_f1984
+ call PrintText
+ ret
+
+ViridianCityText_f1979:
+ TX_FAR _ViridianCityText_191ca
+ db "@"
+
+ViridianCityText_f197e:
+ TX_FAR _ReceivedTM42Text
+ TX_SFX_ITEM_2
+ db "@"
+
+ViridianCityText_f1984:
+ TX_FAR _TM42Explanation
+ db "@"
+
+ViridianCityText_f1989:
+ TX_FAR _TM42NoRoomText
+ db "@"
+
+Func_f198e:
+ ld hl, ViridianCityText_f19b6
+ call PrintText
+ ld c, 2
+ call DelayFrames
+ call YesNoChoice
+ ld a, [wCurrentMenuItem]
+ and a
+ jr nz, .hurry
+ ld hl, ViridianCityText_f19bb
+ call PrintText
+ ld a, $3
+ ld [wViridianCityCurScript], a
+ jr .done
+.hurry
+ ld hl, ViridianCityText_f19c0
+ call PrintText
+.done
+ ret
+
+ViridianCityText_f19b6:
+ TX_FAR _OldManAgainText1
+ db "@"
+
+ViridianCityText_f19bb:
+ TX_FAR _OldManAgainText2
+ db "@"
+
+ViridianCityText_f19c0:
+ TX_FAR _OldManAgainText3
+ db "@"
+
+Func_f19c5:
+ ld hl, ViridianCityText_f19cc
+ call PrintText
+ ret
+
+ViridianCityText_f19cc:
+ TX_FAR _ViridianCityText8
+ db "@"
+
+Func_f19d1:
+ ld hl, ViridianCityText_f19d8
+ call PrintText
+ ret
+
+ViridianCityText_f19d8:
+ TX_FAR _ViridianCityText9
+ db "@"
+
+Func_f19dd:
+ ld hl, ViridianCityText_f19e4
+ call PrintText
+ ret
+
+ViridianCityText_f19e4:
+ TX_FAR _ViridianCityText10
+ db "@"
+
+Func_f19e9:
+ ld hl, ViridianCityText_f19f0
+ call PrintText
+ ret
+
+ViridianCityText_f19f0:
+ TX_FAR _ViridianCityText13
+ db "@"
+
+Func_f19f5:
+ ld hl, ViridianCityText_f19fc
+ call PrintText
+ ret
+
+ViridianCityText_f19fc:
+ TX_FAR _ViridianCityText14
+ db "@"
+
+
+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 acd26b8a..fb9a71e3 100755
--- 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
ViridianForestTrainerHeader0:
dbEventFlagBit EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_0
@@ -55,6 +57,24 @@ ViridianForestTrainerHeader2:
dw ViridianForestEndBattleText3 ; TextEndBattle
dw ViridianForestEndBattleText3 ; TextEndBattle
+ViridianForestTrainerHeader3:
+ dbEventFlagBit EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_3
+ db ($0 << 4) ; trainer's view range
+ dwEventFlagAddress EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_3
+ dw ViridianForestBattleText4 ; TextBeforeBattle
+ dw ViridianForestAfterBattleText4 ; TextAfterBattle
+ dw ViridianForestEndBattleText4 ; TextEndBattle
+ dw ViridianForestEndBattleText4 ; TextEndBattle
+
+ViridianForestTrainerHeader4:
+ dbEventFlagBit EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_4
+ db ($4 << 4) ; trainer's view range
+ dwEventFlagAddress EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_4
+ dw ViridianForestBattleText5 ; TextBeforeBattle
+ dw ViridianForestAfterBattleText5 ; TextAfterBattle
+ dw ViridianForestEndBattleText5 ; TextEndBattle
+ dw ViridianForestEndBattleText5 ; TextEndBattle
+
db $ff
ViridianForestText1:
@@ -64,18 +84,27 @@ ViridianForestText1:
ViridianForestText2:
TX_ASM
ld hl, ViridianForestTrainerHeader0
- call TalkToTrainer
- jp TextScriptEnd
+ jr ViridianForestTalkToTrainer
ViridianForestText3:
TX_ASM
ld hl, ViridianForestTrainerHeader1
- call TalkToTrainer
- jp TextScriptEnd
+ jr ViridianForestTalkToTrainer
ViridianForestText4:
TX_ASM
ld hl, ViridianForestTrainerHeader2
+ jr ViridianForestTalkToTrainer
+
+ViridianForestText5:
+ TX_ASM
+ ld hl, ViridianForestTrainerHeader3
+ jr ViridianForestTalkToTrainer
+
+ViridianForestText6:
+ TX_ASM
+ ld hl, ViridianForestTrainerHeader4
+ViridianForestTalkToTrainer:
call TalkToTrainer
jp TextScriptEnd
@@ -115,30 +144,63 @@ ViridianForestAfterBattleText3:
TX_FAR _ViridianFrstAfterBattleText3
db "@"
-ViridianForestText8:
- TX_FAR _ViridianForestText8
+ViridianForestBattleText4:
+ TX_FAR _ViridianForestBattleTextPikaGirl
+ db "@"
+
+ViridianForestEndBattleText4:
+ TX_FAR _ViridianForestEndBattleTextPikaGirl
+ db "@"
+
+ViridianForestAfterBattleText4:
+ TX_FAR _ViridianForestAfterBattleTextPikaGirl
+ db "@"
+
+ViridianForestBattleText5:
+ TX_FAR _ViridianForestBattleTextSamurai
db "@"
-ViridianForestText9:
- TX_FAR _ViridianForestText9
+ViridianForestEndBattleText5:
+ TX_FAR _ViridianForestEndBattleTextSamurai
+ db "@"
+
+ViridianForestAfterBattleText5:
+ TX_FAR _ViridianForestAfterBattleTextSamurai
db "@"
ViridianForestText10:
- TX_FAR _ViridianForestText10
+ TX_FAR _ViridianForestText8
db "@"
ViridianForestText11:
- TX_FAR _ViridianForestText11
- db "@"
+ TX_ASM
+ ld hl, Func_f2528
+ jp ViridianForestScript_6120d
ViridianForestText12:
- TX_FAR _ViridianForestText12
- db "@"
+ TX_ASM
+ ld hl, Func_f2534
+ jp ViridianForestScript_6120d
ViridianForestText13:
- TX_FAR _ViridianForestText13
- db "@"
+ TX_ASM
+ ld hl, Func_f2540
+ jp ViridianForestScript_6120d
ViridianForestText14:
- TX_FAR _ViridianForestText14
- db "@"
+ TX_ASM
+ ld hl, Func_f254c
+ jp ViridianForestScript_6120d
+
+ViridianForestText15:
+ TX_ASM
+ ld hl, Func_f2558
+ jp ViridianForestScript_6120d
+
+ViridianForestText16:
+ TX_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 100755
index 00000000..489db39c
--- /dev/null
+++ b/scripts/ViridianForest2.asm
@@ -0,0 +1,53 @@
+Func_f2528:
+ ld hl, Text_f252f
+ call PrintText
+ ret
+
+Text_f252f:
+ TX_FAR _ViridianForestText9
+ db "@"
+
+Func_f2534:
+ ld hl, Text_f253b
+ call PrintText
+ ret
+
+Text_f253b:
+ TX_FAR _ViridianForestText10
+ db "@"
+
+Func_f2540:
+ ld hl, Text_f254a
+ call PrintText
+ ret
+
+Text_f254a:
+ TX_FAR _ViridianForestText11
+ db "@"
+
+Func_f254c:
+ ld hl, Text_f2553
+ call PrintText
+ ret
+
+Text_f2553:
+ TX_FAR _ViridianForestText12
+ db "@"
+
+Func_f2558:
+ ld hl, Text_f255f
+ call PrintText
+ ret
+
+Text_f255f:
+ TX_FAR _ViridianForestText13
+ db "@"
+
+Func_f2564:
+ ld hl, ViridianForestText_f256b
+ call PrintText
+ ret
+
+ViridianForestText_f256b:
+ TX_FAR _ViridianForestText14
+ db "@"
diff --git a/scripts/ViridianForestSouthGate.asm b/scripts/ViridianForestSouthGate.asm
index 397f0eca..6eaaaace 100755
--- 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 b90d331c..d1145778 100755
--- 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 14c25b9f..5f324bf7 100755
--- a/scripts/ViridianPokecenter.asm
+++ b/scripts/ViridianPokecenter.asm
@@ -7,6 +7,7 @@ ViridianPokecenter_TextPointers:
dw ViridianPokeCenterText2
dw ViridianPokeCenterText3
dw ViridianTradeNurseText
+ dw ViridianPokeCenterText5
ViridianHealNurseText:
TX_POKECENTER_NURSE
@@ -21,3 +22,8 @@ ViridianPokeCenterText3:
ViridianTradeNurseText:
TX_CABLE_CLUB_RECEPTIONIST
+
+ViridianPokeCenterText5:
+ TX_ASM
+ callab PokecenterChanseyText
+ jp TextScriptEnd
diff --git a/scripts/ViridianSchoolHouse.asm b/scripts/ViridianSchoolHouse.asm
index 2d9579b7..ccfda145 100755
--- 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:
TX_FAR _SchoolText1
db "@"
SchoolText2:
- TX_FAR _SchoolText2
- db "@"
+ TX_ASM
+ callba Func_f1c0f
+ jp TextScriptEnd
+
+SchoolText3:
+ TX_ASM
+ callba Func_f1c03
+ jp TextScriptEnd
diff --git a/scripts/ViridianSchoolHouse2.asm b/scripts/ViridianSchoolHouse2.asm
new file mode 100755
index 00000000..677a43ec
--- /dev/null
+++ b/scripts/ViridianSchoolHouse2.asm
@@ -0,0 +1,17 @@
+Func_f1c03:
+ ld hl, SchoolText_f1c0a
+ call PrintText
+ ret
+
+SchoolText_f1c0a:
+ TX_FAR _SchoolText3
+ db "@"
+
+Func_f1c0f:
+ ld hl, SchoolText_f1c16
+ call PrintText
+ ret
+
+SchoolText_f1c16:
+ TX_FAR _SchoolText2
+ db "@"
diff --git a/text.asm b/text.asm
index 5a760a8e..8a67c231 100644
--- a/text.asm
+++ b/text.asm
@@ -22,7 +22,7 @@ INCLUDE "macros.asm"
INCLUDE "hram.asm"
-SECTION "Text 1", ROMX ; BANK $20
+SECTION "Text 1", ROMX ; BANK $26
_CardKeySuccessText1::
text "Bingo!@@"
@@ -170,6 +170,11 @@ _OaksAideNoRoomText::
text "."
done
+_NurseChanseyText::
+ text "CHANSEY: Chaaan"
+ line "sey!"
+ done
+
INCLUDE "text/maps/ViridianForest.asm"
INCLUDE "text/maps/MtMoon1F.asm"
INCLUDE "text/maps/MtMoonB1F.asm"
@@ -193,16 +198,15 @@ INCLUDE "text/maps/SilphCo2F.asm"
INCLUDE "text/maps/SilphCo3F.asm"
INCLUDE "text/maps/SilphCo4F.asm"
INCLUDE "text/maps/SilphCo5F.asm"
-
-
-SECTION "Text 2", ROMX ; BANK $21
-
-INCLUDE "text/maps/SilphCo5F_2.asm"
INCLUDE "text/maps/SilphCo6F.asm"
INCLUDE "text/maps/SilphCo7F.asm"
INCLUDE "text/maps/SilphCo8F.asm"
INCLUDE "text/maps/SilphCo9F.asm"
INCLUDE "text/maps/SilphCo10F.asm"
+
+
+SECTION "Text 2", ROMX ; BANK $27
+
INCLUDE "text/maps/SilphCo11F.asm"
INCLUDE "text/maps/PokemonMansion2F.asm"
INCLUDE "text/maps/PokemonMansion3F.asm"
@@ -225,11 +229,6 @@ INCLUDE "text/maps/LoreleisRoom.asm"
INCLUDE "text/maps/BrunosRoom.asm"
INCLUDE "text/maps/AgathasRoom.asm"
INCLUDE "text/maps/RockTunnelB1F.asm"
-
-
-SECTION "Text 3", ROMX ; BANK $22
-
-INCLUDE "text/maps/RockTunnelB1F_2.asm"
INCLUDE "text/maps/SeafoamIslandsB4F.asm"
_AIBattleWithdrawText::
@@ -251,6 +250,15 @@ _AIBattleUseItemText::
text "!"
prompt
+_BoxFullTest::
+ text "The BOX is full!"
+ done
+
+_BoxWillBeClearedText::
+ text "The BOX will be"
+ line "cleared."
+ done
+
_TradeWentToText::
TX_RAM wcf4b
text " went"
@@ -551,7 +559,7 @@ _GameOverText::
line "GAME is over!"
done
-_CinnabarGymQuizIntroText::
+_CinnabarGymQuizDummyIntroText::
text "#MON Quiz!"
para "Get it right and"
@@ -570,6 +578,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?"
@@ -831,6 +867,14 @@ _KabutopsFossilText::
cont "rare #MON."
done
+_FanClubPicture1Text::
+ text "My cute RAPIDASH."
+ done
+
+_FanClubPicture2Text::
+ text "My beloved FEAROW."
+ done
+
_LinkCableHelpText1::
text "TRAINER TIPS"
@@ -1169,6 +1213,10 @@ _GotAwayText::
text "Got away safely!"
prompt
+_RunAwayText::
+ text "Hurry, get away!"
+ prompt
+
_ItemsCantBeUsedHereText::
text "Items can't be"
line "used here."
@@ -1199,7 +1247,7 @@ _NoMovesLeftText::
_MultiHitText::
text "Hit the enemy"
line "@"
- TX_NUM wPlayerNumHits,1,1
+ TX_NUM wPlayerNumHits, 1, 1
text " times!"
prompt
@@ -1447,6 +1495,30 @@ _GrewLevelText::
TX_NUM wCurEnemyLVL, 1, 3
text "!@@"
+_SuperEffectiveText::
+ text "It's super"
+ line "effective!"
+ prompt
+
+_NotVeryEffectiveText::
+ text "It's not very"
+ line "effective..."
+ prompt
+
+_SafariZoneEatingText::
+ text "Wild @"
+ TX_RAM wEnemyMonNick
+ text ""
+ line "is eating!"
+ prompt
+
+_SafariZoneAngryText::
+ text "Wild @"
+ TX_RAM wEnemyMonNick
+ text ""
+ line "is angry!"
+ prompt
+
_WildMonAppearedText::
text "Wild @"
TX_RAM wEnemyMonNick
@@ -1462,6 +1534,9 @@ _HookedMonAttackedText::
cont "attacked!"
prompt
+
+SECTION "Text 3", ROMX ; BANK $28
+
_EnemyAppearedText::
TX_RAM wEnemyMonNick
text ""
@@ -1521,30 +1596,6 @@ _ComeBackText::
line "Come back!"
done
-_SuperEffectiveText::
- text "It's super"
- line "effective!"
- prompt
-
-_NotVeryEffectiveText::
- text "It's not very"
- line "effective..."
- prompt
-
-_SafariZoneEatingText::
- text "Wild @"
- TX_RAM wEnemyMonNick
- text ""
- line "is eating!"
- prompt
-
-_SafariZoneAngryText::
- text "Wild @"
- TX_RAM wEnemyMonNick
- text ""
- line "is angry!"
- prompt
-
; money related
_PickUpPayDayMoneyText::
text "<PLAYER> picked up"
@@ -1563,6 +1614,11 @@ _WhichFloorText::
line "you want? "
done
+_SleepingPikachuText1::
+ text "There isn't any"
+ line "response..."
+ prompt
+
_PartyMenuNormalText::
text "Choose a #MON."
done
@@ -1578,7 +1634,7 @@ _PartyMenuBattleText::
done
_PartyMenuUseTMText::
- text "Use TM on which"
+ text "Teach to which"
line "#MON?"
done
@@ -1750,6 +1806,11 @@ _AccessedHoFPCText::
line "OF FAME List."
prompt
+_SleepingPikachuText2::
+ text "There isn't any"
+ line "response..."
+ prompt
+
_SwitchOnText::
text "Switch on!"
prompt
@@ -1803,6 +1864,12 @@ _CantTakeMonText::
line "first."
prompt
+_PikachuUnhappyText::
+ TX_RAM wcd6d
+ text " looks"
+ line "unhappy about it!"
+ prompt
+
_ReleaseWhichMonText::
text "Release which"
line "#MON?"
@@ -1879,19 +1946,16 @@ _AccessedOaksPCText::
line "Rating System."
prompt
-_WhereWouldYouLikeText::
- text "Where would you"
- line "like to go?"
- done
-
-_PleaseWaitText::
- text "OK, please wait"
- line "just a moment."
- done
+_ExpressionText::
+ text "This expression is"
+ line "No. @"
+ TX_NUM wExpressionNumber, 1, 2
+ text "."
+ prompt
-_LinkCanceledText::
- text "The link was"
- line "canceled."
+_NotEnoughMemoryText::
+ text "Not enough Yellow"
+ line "Version memory."
done
INCLUDE "text/oakspeech.asm"
@@ -1924,13 +1988,121 @@ _WillBeTradedText::
cont "be traded."
done
+_Colosseum3MonsText::
+ text "You need 3 #MON"
+ line "to fight!"
+ prompt
+
+_ColosseumMewText::
+ text "Sorry, MEW can't"
+ line "attend!"
+ prompt
+
+_ColosseumDifferentMonsText::
+ text "Your #MON must"
+ line "all be different!"
+ prompt
+
+_ColosseumMaxL55Text::
+ text "No #MON can"
+ line "exceed L55!"
+ prompt
+
+_ColosseumMinL50Text::
+ text "All #MON must"
+ line "be at least L50!"
+ prompt
+
+_ColosseumTotalL155Text::
+ text "Your total levels"
+ line "exceed 155!"
+ prompt
+
+_ColosseumMaxL30Text::
+ text "No #MON can"
+ line "exceed L30!"
+ prompt
+
+_ColosseumMinL25Text::
+ text "All #MON must"
+ line "be at least L25!"
+ prompt
+
+_ColosseumTotalL80Text::
+ text "Your total levels"
+ line "exceed 80!"
+ prompt
+
+_ColosseumMaxL20Text::
+ text "No #MON can"
+ line "exceed L20!"
+ prompt
+
+_ColosseumMinL15Text::
+ text "All #MON must"
+ line "be at least L15!"
+ prompt
+
+_ColosseumTotalL50Text::
+ text "Your total levels"
+ line "exceed 50!"
+ prompt
+
+_ColosseumHeightText::
+ TX_RAM wcd6d
+ text " is over"
+ line "6′8″ tall!"
+ prompt
+
+_ColosseumWeightText::
+ TX_RAM wcd6d
+ text " weighs"
+ line "over 44 pounds!"
+ prompt
+
+_ColosseumEvolvedText::
+ TX_RAM wcd6d
+ text " is an"
+ line "evolved #MON!"
+ prompt
+
+_ColosseumIneligibleText::
+ text "Your opponent is"
+ line "ineligible."
+ prompt
+
+_ColosseumWhereToText::
+ text "Where would you"
+ line "like to go?"
+ done
+
+_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
+
_Char00Text::
- TX_NUM hSpriteIndexOrTextID,1,2
- text " ERROR."
+ TX_NUM hSpriteIndexOrTextID, 1, 2
+ text " error."
done
_Char55Text::
- text $4B,"@@"
+ text $4B, "@@"
+
+_NoPokemonText::
+ text "There are no"
+ line "#MON here!"
+ prompt
INCLUDE "text/maps/DiglettsCaveRoute2.asm"
INCLUDE "text/maps/ViridianForestNorthGate.asm"
@@ -1940,11 +2112,6 @@ INCLUDE "text/maps/ViridianForestSouthGate.asm"
INCLUDE "text/maps/MtMoonPokecenter.asm"
INCLUDE "text/maps/SaffronGates.asm"
INCLUDE "text/maps/Daycare.asm"
-
-
-SECTION "Text 4", ROMX ; BANK $23
-
-INCLUDE "text/maps/Daycare_2.asm"
INCLUDE "text/maps/UndergroundPathRoute6.asm"
INCLUDE "text/maps/UndergroundPathRoute7.asm"
INCLUDE "text/maps/UndergroundPathRoute7Copy.asm"
@@ -1965,6 +2132,7 @@ INCLUDE "text/maps/Route16Gate2F.asm"
INCLUDE "text/maps/Route16FlyHouse.asm"
INCLUDE "text/maps/Route18Gate1F.asm"
INCLUDE "text/maps/Route18Gate2F.asm"
+INCLUDE "text/maps/BeachHouse.asm"
INCLUDE "text/maps/Route22Gate.asm"
INCLUDE "text/maps/VictoryRoad2F.asm"
INCLUDE "text/maps/BillsHouse.asm"
@@ -1977,13 +2145,13 @@ INCLUDE "text/maps/Route6.asm"
INCLUDE "text/maps/Route7.asm"
INCLUDE "text/maps/Route8.asm"
INCLUDE "text/maps/Route9.asm"
-INCLUDE "text/maps/Route10.asm"
-INCLUDE "text/maps/Route11.asm"
-SECTION "Text 5", ROMX ; BANK $24
+SECTION "Text 4", ROMX ; BANK $29
-INCLUDE "text/maps/Route11_2.asm"
+INCLUDE "text/maps/Route9_2.asm"
+INCLUDE "text/maps/Route10.asm"
+INCLUDE "text/maps/Route11.asm"
INCLUDE "text/maps/Route12.asm"
INCLUDE "text/maps/Route13.asm"
INCLUDE "text/maps/Route14.asm"
@@ -1997,11 +2165,6 @@ INCLUDE "text/maps/Route21.asm"
INCLUDE "text/maps/Route22.asm"
INCLUDE "text/maps/Route23.asm"
INCLUDE "text/maps/Route24.asm"
-
-
-SECTION "Text 6", ROMX ; BANK $25
-
-INCLUDE "text/maps/Route24_2.asm"
INCLUDE "text/maps/Route25.asm"
_FileDataDestroyedText::
@@ -2014,6 +2177,10 @@ _WouldYouLikeToSaveText::
line "SAVE the game?"
done
+_SavingText::
+ text "Saving..."
+ done
+
_GameSavedText::
text "<PLAYER> saved"
line "the game!"
@@ -2056,6 +2223,9 @@ _StoppedEvolvingText::
line "stopped evolving!"
prompt
+
+SECTION "Text 5", ROMX ; BANK $2a
+
_IsEvolvingText::
text "What? @"
TX_RAM wcf4b
@@ -2236,16 +2406,6 @@ _TooWeakSubstituteText::
line "a SUBSTITUTE!"
prompt
-_CoinsScatteredText::
- text "Coins scattered"
- line "everywhere!"
- prompt
-
-_GettingPumpedText::
- text "<USER>'s"
- line "getting pumped!"
- prompt
-
_WasSeededText::
text "<TARGET>"
line "was seeded!"
@@ -2271,6 +2431,11 @@ _StatusChangesEliminatedText::
line "are eliminated!"
prompt
+_GettingPumpedText::
+ text "<USER>'s"
+ line "getting pumped!"
+ prompt
+
_StartedSleepingEffect::
text "<USER>"
line "started sleeping!"
@@ -2311,6 +2476,11 @@ _ShroudedInMistText::
line "shrouded in mist!"
prompt
+_CoinsScatteredText::
+ text "Coins scattered"
+ line "everywhere!"
+ prompt
+
_SuckedHealthText::
text "Sucked health from"
line "<TARGET>!"
@@ -2332,6 +2502,7 @@ _ColosseumText1::
INCLUDE "text/maps/RedsHouse1F.asm"
INCLUDE "text/maps/BluesHouse.asm"
INCLUDE "text/maps/OaksLab.asm"
+INCLUDE "text/pokedex_ratings.asm"
INCLUDE "text/maps/ViridianPokecenter.asm"
INCLUDE "text/maps/ViridianMart.asm"
INCLUDE "text/maps/ViridianSchoolHouse.asm"
@@ -2340,11 +2511,6 @@ INCLUDE "text/maps/ViridianGym.asm"
INCLUDE "text/maps/Museum1F.asm"
INCLUDE "text/maps/Museum2F.asm"
INCLUDE "text/maps/PewterGym.asm"
-
-
-SECTION "Text 7", ROMX ; BANK $26
-
-INCLUDE "text/maps/PewterGym_2.asm"
INCLUDE "text/maps/PewterNidoranHouse.asm"
INCLUDE "text/maps/PewterMart.asm"
INCLUDE "text/maps/PewterSpeechHouse.asm"
@@ -2356,6 +2522,11 @@ INCLUDE "text/maps/CeruleanGym.asm"
INCLUDE "text/maps/BikeShop.asm"
INCLUDE "text/maps/CeruleanMart.asm"
INCLUDE "text/maps/CeruleanBadgeHouse.asm"
+
+
+SECTION "Text 6", ROMX ; BANK $2b
+
+INCLUDE "text/maps/CeruleanBadgeHouse_2.asm"
INCLUDE "text/maps/LavenderPokecenter.asm"
INCLUDE "text/maps/PokemonTower1F.asm"
INCLUDE "text/maps/PokemonTower2F.asm"
@@ -2372,13 +2543,20 @@ INCLUDE "text/maps/VermilionPokecenter.asm"
INCLUDE "text/maps/PokemonFanClub.asm"
INCLUDE "text/maps/VermilionMart.asm"
INCLUDE "text/maps/VermilionGym.asm"
+INCLUDE "text/maps/VermilionPidgeyHouse.asm"
+INCLUDE "text/maps/VermilionDock.asm"
+TeachingHMsText::
+ text "Once a #MON"
+ line "learns an HM, the"
+ cont "technique can't"
+ cont "be replaced."
-SECTION "Text 8", ROMX ; BANK $27
+ para "Better think care-"
+ line "fully before you"
+ cont "teach HM moves."
+ done
-INCLUDE "text/maps/VermilionGym_2.asm"
-INCLUDE "text/maps/VermilionPidgeyHouse.asm"
-INCLUDE "text/maps/VermilionDock.asm"
INCLUDE "text/maps/VermilionOldRodHouse.asm"
INCLUDE "text/maps/CeladonMart1F.asm"
INCLUDE "text/maps/CeladonMart2F.asm"
@@ -2393,6 +2571,11 @@ INCLUDE "text/maps/CeladonMansionRoofHouse.asm"
INCLUDE "text/maps/CeladonPokecenter.asm"
INCLUDE "text/maps/CeladonGym.asm"
INCLUDE "text/maps/GameCorner.asm"
+
+
+SECTION "Text 7", ROMX ; BANK $2c
+
+INCLUDE "text/maps/GameCorner_2.asm"
INCLUDE "text/maps/CeladonMart5F.asm"
INCLUDE "text/maps/GameCornerPrizeRoom.asm"
INCLUDE "text/maps/CeladonDiner.asm"
@@ -2404,11 +2587,6 @@ INCLUDE "text/maps/FuchsiaPokecenter.asm"
INCLUDE "text/maps/WardensHouse.asm"
INCLUDE "text/maps/SafariZoneGate.asm"
INCLUDE "text/maps/FuchsiaGym.asm"
-
-
-SECTION "Text 9", ROMX ; BANK $28
-
-INCLUDE "text/maps/FuchsiaGym_2.asm"
INCLUDE "text/maps/FuchsiaMeetingRoom.asm"
INCLUDE "text/maps/FuchsiaGoodRodHouse.asm"
INCLUDE "text/maps/PokemonMansion1F.asm"
@@ -2430,6 +2608,10 @@ INCLUDE "text/maps/SilphCo1F.asm"
INCLUDE "text/maps/SaffronPokecenter.asm"
INCLUDE "text/maps/MrPsychicsHouse.asm"
+_PokemonText::
+ text "#MON!"
+ done
+
_PokemartGreetingText::
text "Hi there!"
next "May I help you?"
@@ -2615,6 +2797,11 @@ _PokemonCenterFarewellText::
line "you again!"
done
+_LooksContentText::
+ text "It looks very"
+ line "content asleep."
+ done
+
_CableClubNPCAreaReservedFor2FriendsLinkedByCableText::
text "This area is"
line "reserved for 2"
@@ -2635,6 +2822,9 @@ _CableClubNPCPleaseApplyHereHaveToSaveText::
cont "to save the game."
done
+
+SECTION "Text 8", ROMX ; BANK $2d
+
_CableClubNPCPleaseWaitText::
text "Please wait.@@"
@@ -2648,9 +2838,6 @@ _CableClubNPCLinkClosedBecauseOfInactivityText::
cont "come again!"
done
-
-SECTION "Text 10", ROMX ; BANK $29
-
_CableClubNPCPleaseComeAgainText::
text "Please come again!"
done
@@ -2661,27 +2848,6 @@ _CableClubNPCMakingPreparationsText::
cont "Please wait."
done
-_UsedStrengthText::
- TX_RAM wcd6d
- text " used"
- line "STRENGTH.@@"
-
-_CanMoveBouldersText::
- TX_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
-
_FlashLightsAreaText::
text "A blinding FLASH"
line "lights the area!"
@@ -2724,6 +2890,27 @@ _CannotGetOffHereText::
line "here."
prompt
+_UsedStrengthText::
+ TX_RAM wcd6d
+ text " used"
+ line "STRENGTH.@@"
+
+_CanMoveBouldersText::
+ TX_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 "@"
@@ -2833,6 +3020,12 @@ _SurfingNoPlaceToGetOffText::
line "to get off!"
prompt
+_RefusingText::
+ TX_RAM wcd6d
+ text ""
+ line "is refusing!"
+ prompt
+
_VitaminStatRoseText::
TX_RAM wcd6d
text "'s"
@@ -2994,8 +3187,10 @@ _BoxFullCannotThrowBallText::
cont "use that item!"
prompt
-
-SECTION "Text 11", ROMX ; BANK $2a
+_DontHavePokemonText::
+ text "You don't have a "
+ line "#MON!"
+ prompt
_ItemUseText001::
text "<PLAYER> used@@"
@@ -3133,12 +3328,11 @@ _Thanks2Text::
done
_AfterTrade2Text::
- text "The @"
+ text "Hello there! Your"
+ line "old @"
TX_RAM wInGameTradeGiveMonName
- text " you"
- line "traded to me"
-
- para "went and evolved!"
+ text " is"
+ cont "magnificent!"
done
_WannaTrade3Text::
@@ -3168,7 +3362,7 @@ _WrongMon3Text::
done
_Thanks3Text::
- text "Thanks pal!"
+ text "Thanks, pal!"
done
_AfterTrade3Text::
@@ -3195,11 +3389,11 @@ _UsedCutText::
prompt
-SECTION "Pokedex Text", ROMX ; BANK $2b
+SECTION "Pokedex Text", ROMX ; BANK $2e
INCLUDE "text/pokedex.asm"
-SECTION "Move Names", ROMX ; BANK $2c
+SECTION "Move Names", ROMX ; BANK $2f
INCLUDE "text/move_names.asm"
diff --git a/text/credits_text.asm b/text/credits_text.asm
index a68c33d3..0010b93a 100755
--- a/text/credits_text.asm
+++ b/text/credits_text.asm
@@ -1,199 +1,264 @@
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
-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/text/map_names.asm b/text/map_names.asm
index cd9f6640..c2642942 100755
--- a/text/map_names.asm
+++ b/text/map_names.asm
@@ -98,7 +98,7 @@ RocketHQName:
SilphCoName:
db "SILPH CO.@"
PokemonMansionName:
- db $4a," MANSION@"
+ db "<pkmn> MANSION@"
SafariZoneName:
db "SAFARI ZONE@"
CeruleanCaveName:
diff --git a/text/maps/AgathasRoom.asm b/text/maps/AgathasRoom.asm
index 9ef5059a..82cbcd81 100644
--- a/text/maps/AgathasRoom.asm
+++ b/text/maps/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/maps/BeachHouse.asm b/text/maps/BeachHouse.asm
new file mode 100644
index 00000000..bc50b837
--- /dev/null
+++ b/text/maps/BeachHouse.asm
@@ -0,0 +1,103 @@
+_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
+
+_BeachHousePikachuText::
+ text "PIKACHU: Pikaa"
+ done
+
+_BeachHouseSign1Text1::
+ text "SURFIN' DUDE's"
+ line "scribbles..."
+
+ para "When I shoot the"
+ line "tube, the tunes"
+ cont "hit the groove!"
+ done
+
+_BeachHouseSign1Text2::
+ text "30 years of waves!"
+ line "SURFIN' DUDE"
+ done
+
+_BeachHouseSign2Text1::
+ text "SURFING TIP 1!"
+
+ para "After flips, line"
+ line "the board up with"
+ cont "a wave for a cool"
+ cont "effect!"
+ done
+
+_BeachHouseSign2Text2::
+ text "SUMMER BEACH HOUSE"
+ line "#MON welcome!"
+ done
+
+_BeachHouseSign3Text1::
+ text "SURFING TIP 2!"
+
+ para "Pulling flips in"
+ line "a jump is totally"
+ cont "rad!"
+ done
+
+_BeachHouseSign3Text2::
+ text "The sea unites"
+ line "all in surfdom!"
+ done
+
+_BeachHousePrinterText1::
+ text "It's some sort of"
+ line "a machine...@@"
+
+_BeachHousePrinterText2::
+ text "SUMMER BEACH HOUSE"
+ line "PRINTER, it says.@@"
+
+_BeachHousePrinterText3::
+ text "The Hi-Score is"
+ line "shown."
+
+ para "PRINT it out?"
+ done
+
+_BeachHousePrinterText4::
+ text "SUMMER BEACH HOUSE"
+ line "PRINTER, it says."
+
+ para "The Hi-Score is"
+ line "shown."
+
+ para "PRINT it out?"
+ done
+
+_BeachHousePrinterText5::
+ text "PRINT completed.@@"
+
+_BeachHousePrinterText6::
+ text "PRINT error!@@"
diff --git a/text/maps/BikeShop.asm b/text/maps/BikeShop.asm
index 86799865..1717c552 100644
--- a/text/maps/BikeShop.asm
+++ b/text/maps/BikeShop.asm
@@ -31,7 +31,7 @@ _BikeShopText_1d824::
_BikeShopComeAgainText::
text "Come back again"
- line "some time!"
+ line "sometime!"
done
_BikeShopText_1d82f::
diff --git a/text/maps/BillsHouse.asm b/text/maps/BillsHouse.asm
index 5ece48d7..858dfe80 100644
--- a/text/maps/BillsHouse.asm
+++ b/text/maps/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/maps/BluesHouse.asm b/text/maps/BluesHouse.asm
index 1898636a..8f1d8ecf 100644
--- a/text/maps/BluesHouse.asm
+++ b/text/maps/BluesHouse.asm
@@ -29,10 +29,10 @@ _DaisyUseMapText::
done
_BluesHouseText2::
- 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
_BluesHouseText3::
diff --git a/text/maps/CeladonCity.asm b/text/maps/CeladonCity.asm
index 1dbd5cdf..1bf76470 100644
--- a/text/maps/CeladonCity.asm
+++ b/text/maps/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::
@@ -84,22 +84,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"
@@ -111,7 +95,7 @@ _CeladonCityText13::
line "#MON GYM"
cont "LEADER: ERIKA"
- para "The Nature Loving"
+ para "The Nature-Loving"
line "Princess!"
done
@@ -148,5 +132,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/maps/CeladonMansion1F.asm b/text/maps/CeladonMansion1F.asm
index fc175cd5..23123892 100644
--- a/text/maps/CeladonMansion1F.asm
+++ b/text/maps/CeladonMansion1F.asm
@@ -1,14 +1,6 @@
_CeladonMansion1Text1::
text "MEOWTH: Meow!@@"
-_CeladonMansion1Text2::
- text "My dear #MON"
- line "keep me company."
-
- para "MEOWTH even brings"
- line "money home!"
- done
-
_CeladonMansion1Text3::
text "CLEFAIRY: Pi"
line "pippippi!@@"
@@ -21,3 +13,52 @@ _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.@@"
+
+_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/maps/CeladonMansion3F.asm b/text/maps/CeladonMansion3F.asm
index c8858281..baf86186 100644
--- a/text/maps/CeladonMansion3F.asm
+++ b/text/maps/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?"
@@ -41,6 +85,13 @@ _CompletedDexText::
cont "Congratulations!"
cont "...@@"
+_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/maps/CeladonMart3F.asm b/text/maps/CeladonMart3F.asm
index 8211750d..7de4a826 100644
--- a/text/maps/CeladonMart3F.asm
+++ b/text/maps/CeladonMart3F.asm
@@ -1,30 +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 "@"
- TX_RAM wcf4b
- text "!@@"
-
-_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"
@@ -96,3 +69,30 @@ _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 "@"
+ TX_RAM wcf4b
+ text "!@@"
+
+_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/maps/CeladonMart4F.asm b/text/maps/CeladonMart4F.asm
index 78fa0b66..c17483c1 100644
--- a/text/maps/CeladonMart4F.asm
+++ b/text/maps/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/maps/CeladonMartRoof.asm b/text/maps/CeladonMartRoof.asm
index 1ed52e86..cfeddaf6 100644
--- a/text/maps/CeladonMartRoof.asm
+++ b/text/maps/CeladonMartRoof.asm
@@ -52,10 +52,7 @@ _CeladonMartRoofText_4850f::
para "@"
TX_RAM wcf4b
text " contains"
- line "ROCK SLIDE!"
-
- para "It can spook the"
- line "target sometimes!@@"
+ line "ROCK SLIDE!@@"
_CeladonMartRoofText_48515::
text "Yay!"
diff --git a/text/maps/CeruleanBadgeHouse.asm b/text/maps/CeruleanBadgeHouse.asm
index 9d701443..4bba10cd 100644
--- a/text/maps/CeruleanBadgeHouse.asm
+++ b/text/maps/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/maps/CeruleanBadgeHouse_2.asm b/text/maps/CeruleanBadgeHouse_2.asm
new file mode 100755
index 00000000..e5da0622
--- /dev/null
+++ b/text/maps/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/maps/CeruleanCity.asm b/text/maps/CeruleanCity.asm
index f0d2c29e..4bc16e7d 100644
--- a/text/maps/CeruleanCity.asm
+++ b/text/maps/CeruleanCity.asm
@@ -121,38 +121,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"
@@ -161,22 +161,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/maps/CeruleanGym.asm b/text/maps/CeruleanGym.asm
index 1d1d6d1c..9f2c4694 100644
--- a/text/maps/CeruleanGym.asm
+++ b/text/maps/CeruleanGym.asm
@@ -2,19 +2,21 @@ _CeruleanGymText_5c7be::
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
_CeruleanGymText_5c7c3::
@@ -35,7 +37,7 @@ _CeruleanGymText_5c7c8::
para "There's more, you"
line "can now use CUT"
- cont "any time!"
+ cont "anytime!"
para "You can CUT down"
line "small bushes to"
@@ -55,14 +57,15 @@ _CeruleanGymText_5c7d3::
done
_CeruleanGymText_5c7d8::
- 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!@@"
+ cont "show you beat me!"
+ prompt
_CeruleanGymBattleText1::
text "I'm more than good"
@@ -125,7 +128,7 @@ _CeruleanGymText_5c82f::
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/maps/CeruleanTradeHouse.asm b/text/maps/CeruleanTradeHouse.asm
index b606613b..791c11d5 100644
--- a/text/maps/CeruleanTradeHouse.asm
+++ b/text/maps/CeruleanTradeHouse.asm
@@ -1,9 +1,39 @@
-_CeruleanHouse1Text1::
- text "My husband likes"
- line "trading #MON."
-
- para "If you are a"
- line "collector, would"
- cont "you please trade"
- cont "with him?"
+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.@@"
+
+MelanieText2::
+ text "I know! Would you"
+ line "take care of this"
+ cont "BULBASAUR?"
done
+
+MelanieText3::
+ text "Please take care"
+ line "of BULBASAUR!@@"
+
+MelanieText4::
+ text "Is BULBASAUR"
+ line "doing well?@@"
+
+MelanieText5::
+ text "Oh..."
+ line "That's too bad...@@"
+
+MelanieBulbasaurText::
+ text "BULBASAUR: Bubba!"
+ line "Zoar!@@"
+
+MelanieOddishText::
+ text "ODDISH: Orddissh!@@"
+
+MelanieSandshrewText::
+ text "SANDSHREW: Pikii!@@"
diff --git a/text/maps/CinnabarGym.asm b/text/maps/CinnabarGym.asm
index 1b531571..ee1fc31a 100644
--- a/text/maps/CinnabarGym.asm
+++ b/text/maps/CinnabarGym.asm
@@ -208,3 +208,46 @@ _CinnabarGymText_75ac7::
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/maps/CinnabarIsland.asm b/text/maps/CinnabarIsland.asm
index 352ab8ea..54552a46 100644
--- a/text/maps/CinnabarIsland.asm
+++ b/text/maps/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/maps/CopycatsHouse1F.asm b/text/maps/CopycatsHouse1F.asm
index 3ec2b151..bd3029fd 100644
--- a/text/maps/CopycatsHouse1F.asm
+++ b/text/maps/CopycatsHouse1F.asm
@@ -16,5 +16,5 @@ _CopycatsHouse1FText2::
done
_CopycatsHouse1FText3::
- text "CHANSEY: Chaan!"
- line "Sii!@@"
+ text "CHANSEY: Chaaan"
+ line "sey!@@"
diff --git a/text/maps/Daycare.asm b/text/maps/Daycare.asm
index 2759c798..479898c8 100644
--- a/text/maps/Daycare.asm
+++ b/text/maps/Daycare.asm
@@ -60,3 +60,37 @@ _DayCareMonNeedsMoreTimeText::
cont "needs some more"
cont "time with me."
prompt
+
+_DayCareAllRightThenText::
+ text "All right then,"
+ line "@@"
+
+_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/maps/Daycare_2.asm b/text/maps/Daycare_2.asm
deleted file mode 100644
index 20c0e5ad..00000000
--- a/text/maps/Daycare_2.asm
+++ /dev/null
@@ -1,33 +0,0 @@
-_DayCareAllRightThenText::
- text "All right then,"
- line "@@"
-
-_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/maps/FightingDojo.asm b/text/maps/FightingDojo.asm
index 3df069c1..a6ccc8c3 100644
--- a/text/maps/FightingDojo.asm
+++ b/text/maps/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/maps/FuchsiaCity.asm b/text/maps/FuchsiaCity.asm
index a90d0021..0392a1ed 100644
--- a/text/maps/FuchsiaCity.asm
+++ b/text/maps/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/maps/FuchsiaGym.asm b/text/maps/FuchsiaGym.asm
index 9108fc79..fc4e8f59 100644
--- a/text/maps/FuchsiaGym.asm
+++ b/text/maps/FuchsiaGym.asm
@@ -24,3 +24,197 @@ _KogaAfterBattleText::
para "Here! Take the"
line "SOULBADGE!"
prompt
+
+_KogaExplainToxicText::
+ 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
+
+_FuchsiaGymText9::
+ 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 "@"
+ TX_RAM wcf4b
+ text "!@@"
+
+_TM06ExplanationText::
+ text ""
+ 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
+
+_FuchsiaGymText_7564e::
+ 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
+
+_FuchsiaGymText_75653::
+ text "It's amazing how"
+ line "ninja can terrify"
+ cont "even now!"
+ done
diff --git a/text/maps/FuchsiaGym_2.asm b/text/maps/FuchsiaGym_2.asm
deleted file mode 100644
index f7b39d9c..00000000
--- a/text/maps/FuchsiaGym_2.asm
+++ /dev/null
@@ -1,193 +0,0 @@
-_KogaExplainToxicText::
- 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
-
-_FuchsiaGymText9::
- 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 "@"
- TX_RAM wcf4b
- text "!@@"
-
-_TM06ExplanationText::
- text ""
- 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
-
-_FuchsiaGymText_7564e::
- 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
-
-_FuchsiaGymText_75653::
- text "It's amazing how"
- line "ninja can terrify"
- cont "even now!"
- done
diff --git a/text/maps/GameCorner.asm b/text/maps/GameCorner.asm
index 1e59f83e..c3e4f88e 100644
--- a/text/maps/GameCorner.asm
+++ b/text/maps/GameCorner.asm
@@ -179,8 +179,3 @@ _CeladonGameCornerText_48f09::
para "A switch behind"
line "the poster!?"
cont "Let's push it!@@"
-
-_CeladonGameCornerText_48f19::
- text "Oops! Forgot the"
- line "COIN CASE!"
- done
diff --git a/text/maps/GameCorner_2.asm b/text/maps/GameCorner_2.asm
new file mode 100755
index 00000000..c288464d
--- /dev/null
+++ b/text/maps/GameCorner_2.asm
@@ -0,0 +1,4 @@
+_CeladonGameCornerText_48f19::
+ text "Oops! Forgot the"
+ line "COIN CASE!"
+ done
diff --git a/text/maps/HallOfFame.asm b/text/maps/HallOfFame.asm
index c799268b..8faefd3f 100644
--- a/text/maps/HallOfFame.asm
+++ b/text/maps/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/maps/LancesRoom.asm b/text/maps/LancesRoom.asm
index ed3dcada..e47b006e 100644
--- a/text/maps/LancesRoom.asm
+++ b/text/maps/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/maps/MtMoon1F.asm b/text/maps/MtMoon1F.asm
index 761a5240..2e8c960e 100644
--- a/text/maps/MtMoon1F.asm
+++ b/text/maps/MtMoon1F.asm
@@ -115,5 +115,5 @@ _MtMoon1AfterBattleText8::
_MtMoon1Text14::
text "Beware! ZUBAT is"
- line "a blood sucker!"
+ line "a bloodsucker!"
done
diff --git a/text/maps/MtMoonB2F.asm b/text/maps/MtMoonB2F.asm
index 472649b9..ab5da5a6 100644
--- a/text/maps/MtMoonB2F.asm
+++ b/text/maps/MtMoonB2F.asm
@@ -1,3 +1,24 @@
+_MtMoonJessieJamesText1::
+ text "Stop right there!@@"
+
+_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!@@"
+
_MtMoon3Text_49f24::
text "You want the"
line "DOME FOSSIL?"
@@ -52,24 +73,6 @@ _MtMoon3Text_49f99::
text "All right. Then"
line "this is mine!@@"
-_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/maps/MtMoonPokecenter.asm b/text/maps/MtMoonPokecenter.asm
index 7bc99dae..ab3cf6ed 100644
--- a/text/maps/MtMoonPokecenter.asm
+++ b/text/maps/MtMoonPokecenter.asm
@@ -16,6 +16,10 @@ _MtMoonPokecenterText3::
cont "news!"
done
+_MtMoonPokecenterText5::
+ text ""
+ 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 ""
- done
diff --git a/text/maps/Museum1F.asm b/text/maps/Museum1F.asm
index 16431bda..ecb511aa 100644
--- a/text/maps/Museum1F.asm
+++ b/text/maps/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/maps/Museum2F.asm b/text/maps/Museum2F.asm
index 4f34a249..12cfe8b2 100644
--- a/text/maps/Museum2F.asm
+++ b/text/maps/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/maps/NameRatersHouse.asm b/text/maps/NameRatersHouse.asm
index 65d3e8a4..7194a927 100644
--- a/text/maps/NameRatersHouse.asm
+++ b/text/maps/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/maps/OaksLab.asm b/text/maps/OaksLab.asm
index 7a6f57b7..097fa931 100644
--- a/text/maps/OaksLab.asm
+++ b/text/maps/OaksLab.asm
@@ -2,67 +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?"
- 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 @"
- TX_RAM wcd6d
- text "!@@"
-
-_OaksLabLastMonText::
- text "That's PROF.OAK's"
- line "last #MON!"
+ text "That's a #"
+ line "BALL. There's a"
+ cont "#MON inside!"
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::
@@ -70,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::
@@ -103,7 +71,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::
@@ -132,9 +104,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."
@@ -188,31 +161,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::
@@ -222,27 +190,67 @@ _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!@@"
+
+_OaksLabRivalTakesText3::
+ text "OAK: <RIVAL>! What"
+ line "are you doing?"
+ prompt
+
+_OaksLabRivalTakesText4::
+ text "<RIVAL>: Gramps, I"
+ line "want this one!"
+ prompt
+
+_OaksLabRivalTakesText5::
+ text "OAK: But, I... Oh,"
+ line "all right then."
+ cont "That #MON is"
+ cont "yours."
-_OaksLabRivalPickingMonText::
- text "<RIVAL>: I'll take"
- line "this one, then!"
+ 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 @"
TX_RAM wcd6d
text "!@@"
+_OaksLabLeavingText::
+ text "OAK: Hey! Don't go"
+ line "away yet!"
+ done
+
_OaksLabRivalChallengeText::
text "<RIVAL>: Wait"
line "<PLAYER>!"
@@ -275,19 +283,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::
@@ -357,121 +394,3 @@ _OaksLabText_1d405::
text "I study #MON as"
line "PROF.OAK's AIDE."
done
-
-_OaksLabText_441cc::
- text "#DEX comp-"
- line "letion is:"
-
- para "@"
- TX_NUM hDexRatingNumMonsSeen, 1, 3
- text " #MON seen"
- line "@"
- TX_NUM 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/maps/PalletTown.asm b/text/maps/PalletTown.asm
index d5eda74f..9ca8dc93 100644
--- a/text/maps/PalletTown.asm
+++ b/text/maps/PalletTown.asm
@@ -3,9 +3,21 @@ _OakAppearsText::
line "Don't go out!@@"
_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/maps/PewterGym.asm b/text/maps/PewterGym.asm
index 6426dd72..0e156577 100644
--- a/text/maps/PewterGym.asm
+++ b/text/maps/PewterGym.asm
@@ -16,3 +16,169 @@ _PewterGymText_5c49e::
cont "Fine then! Show"
cont "me your best!"
done
+
+_PewterGymText_5c4a3::
+ 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
+
+_TM34PreReceiveText::
+ text "Wait! Take this"
+ line "with you!"
+ done
+
+_ReceivedTM34Text::
+ text "<PLAYER> received"
+ line "TM34!@@"
+
+_TM34ExplanationText::
+ text ""
+
+ 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
+
+_PewterGymText_5c4bc::
+ 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!@@"
+
+_PewterGymText_5c4c1::
+ text ""
+
+ 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
+
+_PewterGymText_5c515::
+ 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
+
+_PewterGymText_5c51a::
+ text "All right! Let's"
+ line "get happening!"
+ prompt
+
+_PewterGymText_5c51f::
+ 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
+
+_PewterGymText_5c529::
+ 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/maps/PewterGym_2.asm b/text/maps/PewterGym_2.asm
deleted file mode 100644
index 5312e4f2..00000000
--- a/text/maps/PewterGym_2.asm
+++ /dev/null
@@ -1,144 +0,0 @@
-_PewterGymText_5c4a3::
- 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
-
-_TM34PreReceiveText::
- text "Wait! Take this"
- line "with you!"
- done
-
-_ReceivedTM34Text::
- text "<PLAYER> received"
- line "TM34!@@"
-
-_TM34ExplanationText::
- text ""
-
- 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
-
-_PewterGymText_5c4bc::
- 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!@@"
-
-_PewterGymText_5c4c1::
- text ""
-
- 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
-
-_PewterGymText_5c515::
- 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
-
-_PewterGymText_5c51a::
- text "All right! Let's"
- line "get happening!"
- prompt
-
-_PewterGymText_5c51f::
- 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
-
-_PewterGymText_5c529::
- text "Just as I thought!"
- line "You're #MON"
- cont "champ material!"
- done
diff --git a/text/maps/PewterMart.asm b/text/maps/PewterMart.asm
index 0d5b07a2..4dbc3c02 100644
--- a/text/maps/PewterMart.asm
+++ b/text/maps/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/maps/PewterPokecenter.asm b/text/maps/PewterPokecenter.asm
index 6a1b373e..968f6af0 100644
--- a/text/maps/PewterPokecenter.asm
+++ b/text/maps/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/maps/PokemonFanClub.asm b/text/maps/PokemonFanClub.asm
index 4827f2e8..5fcd469d 100644
--- a/text/maps/PokemonFanClub.asm
+++ b/text/maps/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..."
@@ -125,19 +142,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/maps/PokemonTower7F.asm b/text/maps/PokemonTower7F.asm
index 704a71eb..652cf37a 100644
--- a/text/maps/PokemonTower7F.asm
+++ b/text/maps/PokemonTower7F.asm
@@ -1,3 +1,27 @@
+_PokemonTowerJessieJamesText1::
+ text "Stop right there!@@"
+
+_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!@@"
+
_TowerRescueFujiText::
text "MR.FUJI: Heh? You"
line "came to save me?"
@@ -23,56 +47,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/maps/RedsHouse1F.asm b/text/maps/RedsHouse1F.asm
index 07768af9..633075bb 100644
--- a/text/maps/RedsHouse1F.asm
+++ b/text/maps/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/maps/RockTunnelB1F.asm b/text/maps/RockTunnelB1F.asm
index 1a565eb3..d0437de7 100644
--- a/text/maps/RockTunnelB1F.asm
+++ b/text/maps/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/maps/RockTunnelB1F_2.asm b/text/maps/RockTunnelB1F_2.asm
deleted file mode 100644
index e8e45a7f..00000000
--- a/text/maps/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/maps/RocketHideoutB4F.asm b/text/maps/RocketHideoutB4F.asm
index f3ba43f3..d9e13457 100644
--- a/text/maps/RocketHideoutB4F.asm
+++ b/text/maps/RocketHideoutB4F.asm
@@ -1,3 +1,26 @@
+_RocketHideoutJessieJamesText1::
+ text "Not another step,"
+ line "brat!@@"
+
+_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!@@"
+
_RocketHideout4Text_4557a::
text "So! I must say, I"
line "am impressed you"
@@ -26,38 +49,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/maps/Route10.asm b/text/maps/Route10.asm
index 057ddcb5..a56018f0 100644
--- a/text/maps/Route10.asm
+++ b/text/maps/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/maps/Route11.asm b/text/maps/Route11.asm
index 13e37bdf..451d2bec 100644
--- a/text/maps/Route11.asm
+++ b/text/maps/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/maps/Route11_2.asm b/text/maps/Route11_2.asm
deleted file mode 100644
index b9b68d6d..00000000
--- a/text/maps/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/maps/Route12.asm b/text/maps/Route12.asm
index 82696fda..27befda5 100644
--- a/text/maps/Route12.asm
+++ b/text/maps/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/maps/Route12Gate2F.asm b/text/maps/Route12Gate2F.asm
index 95a89527..5994b5ff 100644
--- a/text/maps/Route12Gate2F.asm
+++ b/text/maps/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/maps/Route14.asm b/text/maps/Route14.asm
index 18e85ed4..9a9de78c 100644
--- a/text/maps/Route14.asm
+++ b/text/maps/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/maps/Route16.asm b/text/maps/Route16.asm
index 45265829..2ef6b02a 100644
--- a/text/maps/Route16.asm
+++ b/text/maps/Route16.asm
@@ -19,7 +19,7 @@ _Route16BattleText2::
done
_Route16EndBattleText2::
- text "Knock"
+ text "Knock-"
line "out!"
prompt
diff --git a/text/maps/Route17.asm b/text/maps/Route17.asm
index a0affd90..f7f59683 100644
--- a/text/maps/Route17.asm
+++ b/text/maps/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/maps/Route22.asm b/text/maps/Route22.asm
index 3a1d28f0..1754627f 100644
--- a/text/maps/Route22.asm
+++ b/text/maps/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/maps/Route24.asm b/text/maps/Route24.asm
index c14b689a..0771aea3 100644
--- a/text/maps/Route24.asm
+++ b/text/maps/Route24.asm
@@ -63,3 +63,122 @@ _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!@@"
+
+_Route24DamianText3::
+ text "Oh... I'd better"
+ line "release it then."
+ done
+
+_Route24DamianText4::
+ text "How's CHARMANDER"
+ line "doing?"
+ done
diff --git a/text/maps/Route24_2.asm b/text/maps/Route24_2.asm
deleted file mode 100644
index 325dea13..00000000
--- a/text/maps/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/maps/Route25.asm b/text/maps/Route25.asm
index 325ab348..4786d830 100644
--- a/text/maps/Route25.asm
+++ b/text/maps/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/maps/Route3.asm b/text/maps/Route3.asm
index 966a0786..14d44e64 100644
--- a/text/maps/Route3.asm
+++ b/text/maps/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/maps/Route6.asm b/text/maps/Route6.asm
index c48b5d3d..71760449 100644
--- a/text/maps/Route6.asm
+++ b/text/maps/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/maps/Route8.asm b/text/maps/Route8.asm
index 57a9a5f9..c0988d70 100644
--- a/text/maps/Route8.asm
+++ b/text/maps/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/maps/Route9.asm b/text/maps/Route9.asm
index 9975000d..741c990c 100644
--- a/text/maps/Route9.asm
+++ b/text/maps/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/maps/Route9_2.asm b/text/maps/Route9_2.asm
new file mode 100755
index 00000000..f3803618
--- /dev/null
+++ b/text/maps/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/maps/SSAnne2FRooms.asm b/text/maps/SSAnne2FRooms.asm
index a9be8cee..c9b29119 100644
--- a/text/maps/SSAnne2FRooms.asm
+++ b/text/maps/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/maps/SSAnneCaptainsRoom.asm b/text/maps/SSAnneCaptainsRoom.asm
index 7bf004da..bbc52bd7 100644
--- a/text/maps/SSAnneCaptainsRoom.asm
+++ b/text/maps/SSAnneCaptainsRoom.asm
@@ -27,7 +27,7 @@ _ReceivingHM01Text::
para "Teach it to your"
line "#MON and you"
cont "can see it CUT"
- cont "any time!"
+ cont "anytime!"
prompt
_ReceivedHM01Text::
@@ -40,7 +40,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/maps/SSAnneKitchen.asm b/text/maps/SSAnneKitchen.asm
index 7fcc9973..b7784019 100644
--- a/text/maps/SSAnneKitchen.asm
+++ b/text/maps/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/maps/SafariZoneGate.asm b/text/maps/SafariZoneGate.asm
index 5c143891..a426d132 100644
--- a/text/maps/SafariZoneGate.asm
+++ b/text/maps/SafariZoneGate.asm
@@ -3,6 +3,25 @@ _SafariZoneEntranceText1::
line "SAFARI ZONE!"
done
+SafariZoneEntranceText_9e814::
+ text "Leaving early?@@"
+
+_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"
@@ -13,7 +32,9 @@ SafariZoneEntranceText_9e6e4::
line "join the hunt?@@"
SafariZoneEntranceText_9e747::
- text "That'll be ¥500"
+ text "That'll be ¥@"
+ TX_BCD wPriceTemp, $c3
+ text ","
line "please!"
para "We only use a"
@@ -42,25 +63,6 @@ _SafariZoneEntranceText_7536a::
line "money!"
done
-SafariZoneEntranceText_9e814::
- text "Leaving early?@@"
-
-_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?"
@@ -92,3 +94,50 @@ _SafariZoneEntranceText_753f0::
text "Sorry, you're a"
line "regular here!"
done
+
+_SafariZoneLowCostText1::
+ text ""
+
+ 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 ""
+
+ para "You're persistent,"
+ line "aren't you?"
+
+ para "OK, you can go in"
+ line "for free, but"
+ cont "just this once!@@"
+
+_SafariZoneLowCostText4::
+ text ""
+ 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/maps/SaffronGates.asm b/text/maps/SaffronGates.asm
index 9bb4601f..35bcadbb 100644
--- a/text/maps/SaffronGates.asm
+++ b/text/maps/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
@@ -19,7 +19,7 @@ _SaffronGateText_1dff1::
text ""
para "..."
- line "Glug glug..."
+ line "Glug, glug..."
cont "..."
cont "Gulp..."
cont "If you want to go"
diff --git a/text/maps/SaffronGym.asm b/text/maps/SaffronGym.asm
index 6f49a331..52ea321b 100644
--- a/text/maps/SaffronGym.asm
+++ b/text/maps/SaffronGym.asm
@@ -132,8 +132,7 @@ _SaffronGymEndBattleText2::
_SaffronGymAfterBattleText2::
text "Psychic #MON"
- line "fear only ghosts"
- cont "and bugs!"
+ line "fear only bugs!"
done
_SaffronGymBattleText3::
diff --git a/text/maps/SilphCo10F.asm b/text/maps/SilphCo10F.asm
index e916c64a..09894764 100644
--- a/text/maps/SilphCo10F.asm
+++ b/text/maps/SilphCo10F.asm
@@ -1,6 +1,6 @@
_SilphCo10Text_5a1d3::
text "Waaaaa!"
- cont "I'm scared!"
+ line "I'm scared!"
done
_SilphCo10Text_5a1d8::
@@ -40,3 +40,27 @@ _SilphCo10AfterBattleText2::
line "with beating me?"
cont "Then go on home!"
done
+
+_SilphCoJessieJamesText1::
+ text "Hold it right"
+ line "there, brat!@@"
+
+_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...@@"
diff --git a/text/maps/SilphCo11F.asm b/text/maps/SilphCo11F.asm
index fbaa6086..d2bbde7d 100644
--- a/text/maps/SilphCo11F.asm
+++ b/text/maps/SilphCo11F.asm
@@ -58,7 +58,7 @@ _SilphCo11Text2::
done
_SilphCo11Text3::
- text "Ah <PLAYER>!"
+ text "Ah, <PLAYER>!"
line "So we meet again!"
para "The PRESIDENT and"
@@ -70,7 +70,7 @@ _SilphCo11Text3::
line "out of grown-up"
cont "matters..."
- para "Or, experience a"
+ para "or, experience a"
line "world of pain!"
done
@@ -96,21 +96,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"
@@ -127,8 +112,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/maps/SilphCo2F.asm b/text/maps/SilphCo2F.asm
index bd87630a..912bdef9 100644
--- a/text/maps/SilphCo2F.asm
+++ b/text/maps/SilphCo2F.asm
@@ -72,7 +72,7 @@ _SilphCo2EndBattleText3::
prompt
_SilphCo2AfterBattleText3::
- text "Diamond shaped"
+ text "Diamond-shaped"
line "tiles are"
cont "teleport blocks!"
diff --git a/text/maps/SilphCo5F.asm b/text/maps/SilphCo5F.asm
index dab42539..9c8bfd41 100644
--- a/text/maps/SilphCo5F.asm
+++ b/text/maps/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/maps/SilphCo5F_2.asm b/text/maps/SilphCo5F_2.asm
deleted file mode 100644
index 3c1b8ead..00000000
--- a/text/maps/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/maps/SilphCo7F.asm b/text/maps/SilphCo7F.asm
index 1cc2bc30..8f7b6ca2 100644
--- a/text/maps/SilphCo7F.asm
+++ b/text/maps/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/maps/VermilionCity.asm b/text/maps/VermilionCity.asm
index 1cbc535c..742d0c5d 100644
--- a/text/maps/VermilionCity.asm
+++ b/text/maps/VermilionCity.asm
@@ -70,7 +70,7 @@ _VermilionCityText5::
text "MACHOP: Guoh!"
line "Gogogoh!@@"
-_VermilionCityText14::
+_VermilionCityText15::
text ""
para "A MACHOP is"
line "stomping the land"
@@ -86,13 +86,54 @@ _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!@@"
+
+_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"
@@ -106,13 +147,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"
@@ -121,6 +162,6 @@ _VermilionCityText12::
line "American!"
done
-_VermilionCityText13::
+_VermilionCityText14::
text "VERMILION HARBOR"
done
diff --git a/text/maps/VermilionGym.asm b/text/maps/VermilionGym.asm
index 14e0bcea..2d9654c8 100644
--- a/text/maps/VermilionGym.asm
+++ b/text/maps/VermilionGym.asm
@@ -1,21 +1,166 @@
_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 "@"
+ TX_RAM wcf4b
+ text "!@@"
+
+_TM24ExplanationText::
+ text ""
+
+ 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
+
+_VermilionGymFanPreBattleText::
+ 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
+
+_VermilionGymFanPostBattleText::
+ text "Whew! That match"
+ line "was electric!"
done
diff --git a/text/maps/VermilionGym_2.asm b/text/maps/VermilionGym_2.asm
deleted file mode 100644
index 50da9719..00000000
--- a/text/maps/VermilionGym_2.asm
+++ /dev/null
@@ -1,144 +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 "@"
- TX_RAM wcf4b
- text "!@@"
-
-_TM24ExplanationText::
- text ""
-
- 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
-
-_VermilionGymFanPreBattleText::
- 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
-
-_VermilionGymFanPostBattleText::
- text "Whew! That match"
- line "was electric!"
- done
diff --git a/text/maps/ViridianCity.asm b/text/maps/ViridianCity.asm
index 67ab5c40..22d5d7ba 100644
--- a/text/maps/ViridianCity.asm
+++ b/text/maps/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
@@ -97,44 +134,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/maps/ViridianForest.asm b/text/maps/ViridianForest.asm
index 813b193a..f88a484c 100644
--- a/text/maps/ViridianForest.asm
+++ b/text/maps/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/maps/ViridianForestSouthGate.asm b/text/maps/ViridianForestSouthGate.asm
index c1a8df22..a5278742 100644
--- a/text/maps/ViridianForestSouthGate.asm
+++ b/text/maps/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/maps/ViridianGym.asm b/text/maps/ViridianGym.asm
index 4c7b5207..53b78a0f 100644
--- a/text/maps/ViridianGym.asm
+++ b/text/maps/ViridianGym.asm
@@ -38,7 +38,7 @@ _ViridianGymText_74ad9::
cont "of #MON!"
para "Let us meet again"
- line "some day!"
+ line "someday!"
cont "Farewell!@@"
_ViridianGymText12::
@@ -206,7 +206,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/maps/ViridianMart.asm b/text/maps/ViridianMart.asm
index 61750afe..31a843ae 100644
--- a/text/maps/ViridianMart.asm
+++ b/text/maps/ViridianMart.asm
@@ -20,11 +20,13 @@ ViridianMartParcelQuestText::
line "OAK's PARCEL!@@"
_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/maps/ViridianPokecenter.asm b/text/maps/ViridianPokecenter.asm
index 4ac18bf6..4ac18bf6 100644..100755
--- a/text/maps/ViridianPokecenter.asm
+++ b/text/maps/ViridianPokecenter.asm
diff --git a/text/maps/ViridianSchoolHouse.asm b/text/maps/ViridianSchoolHouse.asm
index f6041e0d..3c5f6379 100644
--- a/text/maps/ViridianSchoolHouse.asm
+++ b/text/maps/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/move_names.asm b/text/move_names.asm
index f8706ee3..cbb1a322 100644
--- a/text/move_names.asm
+++ b/text/move_names.asm
@@ -164,4 +164,3 @@ MoveNames::
db "SLASH@"
db "SUBSTITUTE@"
db "STRUGGLE@"
-
diff --git a/text/pokedex.asm b/text/pokedex.asm
index 65f3d89d..7e84a83d 100644
--- a/text/pokedex.asm
+++ b/text/pokedex.asm
@@ -1,1510 +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/text/pokedex_ratings.asm b/text/pokedex_ratings.asm
new file mode 100644
index 00000000..b94a9868
--- /dev/null
+++ b/text/pokedex_ratings.asm
@@ -0,0 +1,117 @@
+_DexCompletionText::
+ text "#DEX comp-"
+ line "letion is:"
+
+ para "@"
+ TX_NUM hDexRatingNumMonsSeen, 1, 3
+ text " #MON seen"
+ line "@"
+ TX_NUM 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/text/unused_names.asm b/text/unused_names.asm
index 4aca7ca2..dd4c9a12 100644
--- a/text/unused_names.asm
+++ b/text/unused_names.asm
@@ -1,4 +1,4 @@
-UnusedNames::
+UnusedNames:
db "かみなりバッヂ@"
db "かいがらバッヂ@"
db "おじぞうバッヂ@"
@@ -17,4 +17,4 @@ UnusedNames::
db "キャプテン@"
db "プチマスター@"
db "マスター@"
- db "エクセレント"
+ db "エクセレント" ; note the lack of a terminator
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/wram.asm b/wram.asm
index 12d52324..265936f0 100755
--- a/wram.asm
+++ b/wram.asm
@@ -201,8 +201,9 @@ wFrequencyModifier:: ; c0f1
wTempoModifier:: ; c0f2
ds 1
- ds 13
-
+wc0f3:: ds 1
+wc0f4:: ds 1
+wc0f5:: ds 11
SECTION "Sprite State Data", WRAM0
@@ -243,22 +244,22 @@ spritestatedata1: MACRO
\1End::
endm
-wSpritePlayerStateData1:: spritestatedata1 wSpritePlayerStateData1
-wSprite01StateData1:: spritestatedata1 wSprite01StateData1
-wSprite02StateData1:: spritestatedata1 wSprite02StateData1
-wSprite03StateData1:: spritestatedata1 wSprite03StateData1
-wSprite04StateData1:: spritestatedata1 wSprite04StateData1
-wSprite05StateData1:: spritestatedata1 wSprite05StateData1
-wSprite06StateData1:: spritestatedata1 wSprite06StateData1
-wSprite07StateData1:: spritestatedata1 wSprite07StateData1
-wSprite08StateData1:: spritestatedata1 wSprite08StateData1
-wSprite09StateData1:: spritestatedata1 wSprite09StateData1
-wSprite10StateData1:: spritestatedata1 wSprite10StateData1
-wSprite11StateData1:: spritestatedata1 wSprite11StateData1
-wSprite12StateData1:: spritestatedata1 wSprite12StateData1
-wSprite13StateData1:: spritestatedata1 wSprite13StateData1
-wSprite14StateData1:: spritestatedata1 wSprite14StateData1
-wSprite15StateData1:: spritestatedata1 wSprite15StateData1
+wSpritePlayerStateData1:: spritestatedata1 wSpritePlayerStateData1
+wSprite01StateData1:: spritestatedata1 wSprite01StateData1
+wSprite02StateData1:: spritestatedata1 wSprite02StateData1
+wSprite03StateData1:: spritestatedata1 wSprite03StateData1
+wSprite04StateData1:: spritestatedata1 wSprite04StateData1
+wSprite05StateData1:: spritestatedata1 wSprite05StateData1
+wSprite06StateData1:: spritestatedata1 wSprite06StateData1
+wSprite07StateData1:: spritestatedata1 wSprite07StateData1
+wSprite08StateData1:: spritestatedata1 wSprite08StateData1
+wSprite09StateData1:: spritestatedata1 wSprite09StateData1
+wSprite10StateData1:: spritestatedata1 wSprite10StateData1
+wSprite11StateData1:: spritestatedata1 wSprite11StateData1
+wSprite12StateData1:: spritestatedata1 wSprite12StateData1
+wSprite13StateData1:: spritestatedata1 wSprite13StateData1
+wSprite14StateData1:: spritestatedata1 wSprite14StateData1
+wSpritePikachuStateData1:: spritestatedata1 wSpritePikachuStateData1
wSpriteStateData2:: ; c200
; more data for all sprites on the current map
@@ -296,23 +297,22 @@ spritestatedata2: MACRO
\1End::
endm
-wSpritePlayerStateData2:: spritestatedata2 wSpritePlayerStateData2
-wSprite01StateData2:: spritestatedata2 wSprite01StateData2
-wSprite02StateData2:: spritestatedata2 wSprite02StateData2
-wSprite03StateData2:: spritestatedata2 wSprite03StateData2
-wSprite04StateData2:: spritestatedata2 wSprite04StateData2
-wSprite05StateData2:: spritestatedata2 wSprite05StateData2
-wSprite06StateData2:: spritestatedata2 wSprite06StateData2
-wSprite07StateData2:: spritestatedata2 wSprite07StateData2
-wSprite08StateData2:: spritestatedata2 wSprite08StateData2
-wSprite09StateData2:: spritestatedata2 wSprite09StateData2
-wSprite10StateData2:: spritestatedata2 wSprite10StateData2
-wSprite11StateData2:: spritestatedata2 wSprite11StateData2
-wSprite12StateData2:: spritestatedata2 wSprite12StateData2
-wSprite13StateData2:: spritestatedata2 wSprite13StateData2
-wSprite14StateData2:: spritestatedata2 wSprite14StateData2
-wSprite15StateData2:: spritestatedata2 wSprite15StateData2
-
+wSpritePlayerStateData2:: spritestatedata2 wSpritePlayerStateData2
+wSprite01StateData2:: spritestatedata2 wSprite01StateData2
+wSprite02StateData2:: spritestatedata2 wSprite02StateData2
+wSprite03StateData2:: spritestatedata2 wSprite03StateData2
+wSprite04StateData2:: spritestatedata2 wSprite04StateData2
+wSprite05StateData2:: spritestatedata2 wSprite05StateData2
+wSprite06StateData2:: spritestatedata2 wSprite06StateData2
+wSprite07StateData2:: spritestatedata2 wSprite07StateData2
+wSprite08StateData2:: spritestatedata2 wSprite08StateData2
+wSprite09StateData2:: spritestatedata2 wSprite09StateData2
+wSprite10StateData2:: spritestatedata2 wSprite10StateData2
+wSprite11StateData2:: spritestatedata2 wSprite11StateData2
+wSprite12StateData2:: spritestatedata2 wSprite12StateData2
+wSprite13StateData2:: spritestatedata2 wSprite13StateData2
+wSprite14StateData2:: spritestatedata2 wSprite14StateData2
+wSpritePikachuStateData2:: spritestatedata2 wSpritePikachuStateData2
wSpriteDataEnd::
@@ -322,10 +322,11 @@ SECTION "OAM Buffer", WRAM0
wOAMBuffer:: ; c300
; buffer for OAM data. Copied to OAM by DMA
ds 4 * 40
+wOAMBufferEnd::
wTileMap:: ; c3a0
; buffer for tiles that are visible on screen (20 columns by 18 rows)
- ds 20 * 18
+ ds SCREEN_HEIGHT * SCREEN_WIDTH
wSerialPartyMonsPatchList:: ; c508
; list of indexes to patch with SERIAL_NO_DATA_BYTE after transfer
@@ -335,17 +336,248 @@ wTileMapBackup:: ; c508
; (e.g. if menus are drawn on top)
; ds 20 * 18
- ds 200
+wAnimatedObjectsData::
+; Used by functions in BANK 3E
+; This looks similar to the address structure for Gen 2 OAM animations.
+
+wAnimatedObjectStartTileOffsets::
+ ds 10 * 2
+wAnimatedObjectDataStructs:: ; c51c
+animated_object: macro
+\1Index:: db ; 0
+\1FramesetID:: db ; 1
+\1AnimSeqID:: db ; 2
+\1TileID:: db ; 3
+\1XCoord:: db ; 4
+\1YCoord:: db ; 5
+\1XOffset:: db ; 6
+\1YOffset:: db ; 7
+\1Duration:: db ; 8
+\1DurationOffset:: db ; 9
+\1FrameIndex:: db ; a
+ ds 5
+\1End::
+ endm
+
+wAnimatedObject0:: animated_object wAnimatedObject0
+wAnimatedObject1:: animated_object wAnimatedObject1
+wAnimatedObject2:: animated_object wAnimatedObject2
+wAnimatedObject3:: animated_object wAnimatedObject3
+wAnimatedObject4:: animated_object wAnimatedObject4
+wAnimatedObject5:: animated_object wAnimatedObject5
+wAnimatedObject6:: animated_object wAnimatedObject6
+wAnimatedObject7:: animated_object wAnimatedObject7
+wAnimatedObject8:: animated_object wAnimatedObject8
+wAnimatedObject9:: animated_object wAnimatedObject9
+
+wNumLoadedAnimatedObjects:: ; c5bc
+ ds 1
+wCurrentAnimatedObjectOAMBufferOffset:: ; c5bd
+ ds 3
+wAnimatedObjectSpawnStateDataPointer:: ; c5c0
+ ds 2
+wAnimatedObjectFramesDataPointer:: ; c5c2
+ ds 2
+wAnimatedObjectJumptablePointer:: ; c5c4
+ ds 2
+wAnimatedObjectOAMDataPointer:: ; c5c6
+ ds 2
+wCurAnimatedObjectOAMAttributes:: ; c5c8
+ ds 1
+wCurrentAnimatedObjectVTileOffset:: ; c5c9
+ ds 1
+wCurrentAnimatedObjectXCoord:: ; c5ca
+ ds 1
+wCurrentAnimatedObjectYCoord:: ; c5cb
+ ds 1
+wCurrentAnimatedObjectXOffset:: ; c5cc
+ ds 1
+wCurrentAnimatedObjectYOffset:: ; c5cd
+ ds 1
+wAnimatedObjectGlobalYOffset:: ; c5ce
+ ds 1
+wAnimatedObjectGlobalXOffset:: ; c5cf
+ ds 1
+wAnimatedObjectsDataEnd::
wSerialEnemyMonsPatchList:: ; c5d0
; list of indexes to patch with SERIAL_NO_DATA_BYTE after transfer
- ds 200
- ds 80
+; Surfing Minigame
+wSurfingMinigameData:: ; c5d0
+ ds 1
+wSurfingMinigameRoutineNumber:: ; c5d1
+ ds 1
+wc5d2:: ; c5d2
+ ds 1
+wSurfingMinigameWaveFunctionNumber:: ; c5d3
+ ds 2
+wc5d5:: ; c5d5
+ ds 1
+wSurfingMinigamePikachuHP:: ; c5d6
+ ds 2 ; little-endian BCD
+wc5d8:: ; c5d8 unused?
+ ds 1
+wSurfingMinigameRadnessMeter:: ; c5d9
+; number of consecutive tricks
+ ds 1
+wSurfingMinigameRadnessScore:: ; c5da
+ ds 2 ; little-endian BCD
+wSurfingMinigameTotalScore:: ; c5dc
+ ds 2 ; little-endian BCD
+wc5de:: ; c5de
+ ds 1
+wc5df:: ; c5df
+ ds 1
+wc5e0:: ; c5e0
+ ds 1
+wc5e1:: ; c5e1
+ ds 1
+wc5e2:: ; c5e2
+ ds 1
+wSurfingMinigamePikachuSpeed:: ; c5e3
+ ds 2 ; little-endian
+wc5e5:: ; c5e5
+ ds 3 ; big-endian
+wSurfingMinigameWaveHeightBuffer:: ; c5e8
+ ds 2
+wSurfingMinigamePikachuObjectHeight:: ; c5ea
+ ds 1
+wc5eb:: ; c5eb
+ ds 1
+wc5ec:: ; c5ec
+ ds 1
+wc5ed:: ; c5ed
+ ds 1
+wc5ee:: ; c5ee
+ ds 1
+wSurfingMinigameBGMapReadBuffer:: ; c5ef
+ ds 16
-wTempPic::
+ ds 24
+wSurfingMinigameSCX:: ; c617
+ ds 3
+wSurfingMinigameWaveHeight:: ; c61a
+ ds SCREEN_WIDTH
+wSurfingMinigameXOffset:: ; c62e
+ ds 1
+wSurfingMinigameTrickFlags:: ; c62f
+ ds 1
+wc630:: ; c630
+ ds 1
+wc631:: ; c631
+ ds 1
+wSurfingMinigameRoutineDelay:: ; c632
+ ds 1
+wSurfingMinigameIntroAnimationFinished:: ; c633
+ ds 1
+
+wYellowIntroCurrentScene:: ; c634
+wc634:: ; c634
+ ds 1
+wYellowIntroSceneTimer:: ; c635
+wc635:: ; c635
+ ds 1
+wYellowIntroAnimatedObjectStructPointer:: ; c636
+ ds 1
+wSurfingMinigameDataEnd:: ; c637
+
+ ds 177
+
+wTempPic:: ; c6e8
+wPrinterData:: ; c6e8
wOverworldMap:: ; c6e8
- ds 1300
+ ; ds 1300
+wPrinterSendState:: ; c6e8
+ ds 1
+wPrinterRowIndex:: ; c6e9
+ ds 1
+
+; Printer data header
+wPrinterDataHeader:: ; c6ea
+wc6ea:: ; c6ea
+ ds 1
+wc6eb:: ; c6eb
+ ds 1
+wc6ec:: ; c6ec
+ ds 1
+wc6ed:: ; c6ed
+ ds 1
+wPrinterChecksum:: ; c6ee
+ dw
+
+UNION
+
+wPrinterSerialReceived:: ; c6f0
+ ds 1
+wPrinterStatusReceived:: ; c6f1
+; 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)
+ ds 1
+
+wc6f2:: ; c6f2
+ ds 1
+wc6f3:: ; c6f3
+ ds 13
+wLYOverrides:: ; c700
+ ds $100
+wLYOverridesEnd::
+wLYOverridesBuffer:: ; c800
+ ds $100
+wLYOverridesBufferEnd:: ; c900
+
+NEXTU
+
+wPrinterSendDataSource1:: ; c6f0
+; two 20-tile buffers
+ ds $140
+wPrinterSendDataSource2::
+ ds $140
+ENDU
+
+wPrinterSendDataSource1End:: ; c970
+
+wPrinterHandshake:: ; c970
+ ds 1
+wPrinterStatusFlags:: ; c971
+ ds 1
+wHandshakeFrameDelay:: ; c972
+ ds 1
+wPrinterSerialFrameDelay:: ; c973
+ ds 1
+wPrinterSendByteOffset:: ; c974
+ dw
+wPrinterDataSize:: ; c976
+ dw
+wPrinterTileBuffer:: ; c978
+ ds SCREEN_HEIGHT * SCREEN_WIDTH
+wPrinterStatusIndicator:: ; cae0
+ ds 2
+wcae2:: ; cae2
+ ds 1
+wPrinterSettingsTempCopy:: ; cae3
+ ds 17
+wPrinterQueueLength:: ; caf4
+ ds 1
+wPrinterDataEnd:: ; caf5
+
+wPrinterPokedexEntryTextPointer:: ; caf5
+ dw
+ ds 2
+wPrinterPokedexMonIsOwned:: ; caf9
+ ds 227
+
+wcbdc:: ; cbdc
+ ds 14
+
+wcbea:: ; cbea
+ ds 2
+
+wcbec:: ; cbec
+ ds 16
+
wOverworldMapEnd::
wRedrawRowOrColumnSrcTiles:: ; cbfc
@@ -482,9 +714,7 @@ wUnknownSerialCounter:: ; cc47
; 2 bytes
wEnteringCableClub:: ; cc47
- ds 1
-
- ds 1
+ ds 2
wWhichTradeMonSelectionMenu:: ; cc49
; $00 = player mons
@@ -573,19 +803,26 @@ wAnimationType:: ; cc5b
; values between 0-6. Shake screen horizontally, shake screen vertically, blink Pokemon...
wNPCMovementDirections:: ; cc5b
+
+wPikaPicUsedGFXCount:: ; cc5b
ds 1
+wPikaPicUsedGFX:: ; cc5c
wDexRatingNumMonsOwned:: ; cc5c
ds 1
+
wDexRatingText:: ; cc5d
+wTrainerCardBadgeAttributes:: ; cc5d
ds 1
wSlotMachineSavedROMBank:: ; cc5e
; ROM back to return to when the player is done with the slot machine
ds 1
- ds 26
+ ds 13
+wPikaPicUsedGFXEnd:: ; cc6c
+ ds 13
wAnimPalette:: ; cc79
ds 1
@@ -594,13 +831,30 @@ wAnimPalette:: ; cc79
wNPCMovementDirections2:: ; cc97
+wPikaPicAnimObjectDataBufferSize:: ; cc97
+
wSwitchPartyMonTempBuffer:: ; cc97
; temporary buffer when swapping party mon data
- ds 10
+ ds 1
+
+wPikaPicAnimObjectDataBuffer:: ; cc98
+; 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 9
wNumStepsToTake:: ; cca1
; used in Pallet Town scripted movement
- ds 49
+ ds 23
+wPikaPicAnimObjectDataBufferEnd:: ;ccb8
+ ds 26
wRLEByteCount:: ; ccd2
ds 1
@@ -812,7 +1066,7 @@ wEnemyMonAccuracyMod:: ; cd32
wEnemyMonEvasionMod:: ; cd33
ds 1
-wInGameTradeReceiveMonSpecies::
+wInGameTradeReceiveMonSpecies:: ; cd34
ds 1
ds 2
@@ -893,7 +1147,7 @@ wWhichBadge:: ; cd3d
wPriceTemp:: ; cd3d
; 3-byte BCD number
-wTitleMonSpecies:: ; cd3d
+wTitleScreenScene:: ; cd3d
wPlayerCharacterOAMTile:: ; cd3d
@@ -906,7 +1160,7 @@ wCoordIndex:: ; cd3d
wOptionsTextSpeedCursorX:: ; cd3d
-wBoxNumString:: ; cd3d
+wOptionsCursorLocation:: ; cd3d
wTrainerInfoTextBoxWidthPlus1:: ; cd3d
@@ -944,6 +1198,8 @@ wPlayerSpinInPlaceAnimFrameDelay:: ; cd3d
wPlayerSpinWhileMovingUpOrDownAnimDeltaY:: ; cd3d
+wBoxNumString:: ; cd3d
+
wHiddenObjectFunctionArgument:: ; cd3d
wWhichTrade:: ; cd3d
@@ -954,6 +1210,8 @@ wTrainerSpriteOffset:: ; cd3d
wUnusedCD3D:: ; cd3d
ds 1
+wTitleScreenTimer:: ; cd3e
+
wHUDPokeballGfxOffsetX:: ; cd3e
; difference in X between the next ball and the current one
@@ -997,6 +1255,8 @@ wPlayerSpinWhileMovingUpOrDownAnimMaxY:: ; cd3e
wHiddenObjectFunctionRomBank:: ; cd3e
wTrainerEngageDistance:: ; cd3e
+
+wJigglypuffFacingDirections2:: ; cd3e
ds 1
wHUDGraphicsTiles:: ; cd3f
@@ -1031,6 +1291,7 @@ wPlayerSpinWhileMovingUpOrDownAnimFrameDelay:: ; cd3f
wHiddenObjectIndex:: ; cd3f
wTrainerFacingDirection:: ; cd3f
+
ds 1
wHoFMonOrPlayer:: ; cd40
@@ -1076,6 +1337,8 @@ wHoFTeamNo:: ; cd42
wSlotMachineWheel1MiddleTile:: ; cd42
wFieldMovesLeftmostXCoord:: ; cd42
+
+wcd42:: ; cd42
ds 1
wLastFieldMoveID:: ; cd43
@@ -1371,7 +1634,7 @@ wTextPredefFlag:: ; cf11
wPredefParentBank:: ; cf12
ds 1
-wSpriteIndex:: ds 1
+wSpriteIndex:: ds 1 ; cf13
wCurSpriteMovement2:: ; cf14
; movement byte 2 of current sprite
@@ -1388,29 +1651,26 @@ wScriptedNPCWalkCounter:: ; cf18
ds 1
-wGBC:: ; cf1a
- ds 1
-
-wOnSGB:: ; cf1b
+wOnSGB:: ; cf1a
; if running on SGB, it's 1, else it's 0
ds 1
-wDefaultPaletteCommand:: ; cf1c
+wDefaultPaletteCommand:: ; cf1b
ds 1
-wPlayerHPBarColor:: ; cf1d
+wPlayerHPBarColor:: ; cf1c
-wWholeScreenPaletteMonSpecies:: ; cf1d
+wWholeScreenPaletteMonSpecies:: ; cf1c
; species of the mon whose palette is used for the whole screen
ds 1
-wEnemyHPBarColor:: ; cf1e
+wEnemyHPBarColor:: ; cf1d
ds 1
; 0: green
; 1: yellow
; 2: red
-wPartyMenuHPBarColors:: ; cf1f
+wPartyMenuHPBarColors:: ; cf1e
ds 6
wStatusScreenHPBarColor:: ; cf25
@@ -1427,95 +1687,97 @@ wPalPacket:: ; cf2d
wPartyMenuBlkPacket:: ; cf2e
; $30 bytes
- ds 29
+ ds 9
+wPartyHPBarAttributes:: ; cf36
+ ds 20
-wExpAmountGained:: ; cf4b
+wExpAmountGained:: ; cf4a
; 2-byte big-endian number
; the total amount of exp a mon gained
wcf4b:: ds 2 ; storage buffer for various strings
-wGainBoostedExp:: ; cf4d
+wGainBoostedExp:: ; cf4c
ds 1
ds 17
-wGymCityName:: ; cf5f
+wGymCityName:: ; cf5e
ds 17
-wGymLeaderName:: ; cf70
+wGymLeaderName:: ; cf6f
ds NAME_LENGTH
-wItemList:: ; cf7b
+wItemList:: ; cf7a
ds 16
-wListPointer:: ; cf8b
+wListPointer:: ; cf8a
ds 2
-wUnusedCF8D:: ; cf8d
+wUnusedCF8D:: ; cf8c
; 2 bytes
; used to store pointers, but never read
ds 2
-wItemPrices:: ; cf8f
+wItemPrices:: ; cf8e
ds 2
-wcf91:: ds 1 ; used with a lot of things (too much to list here)
+wcf91:: ds 1 ; used with a lot of things (too much to list here) ; cf90
-wWhichPokemon:: ; cf92
+wWhichPokemon:: ; cf91
; which pokemon you selected
ds 1
-wPrintItemPrices:: ; cf93
+wPrintItemPrices:: ; cf92
; if non-zero, then print item prices when displaying lists
ds 1
-wHPBarType:: ; cf94
+wHPBarType:: ; cf93
; type of HP bar
; $00 = enemy HUD in battle
; $01 = player HUD in battle / status screen
; $02 = party menu
-wListMenuID:: ; cf94
+wListMenuID:: ; cf93
; ID used by DisplayListMenuID
ds 1
-wRemoveMonFromBox:: ; cf95
+wRemoveMonFromBox:: ; cf94
; if non-zero, RemovePokemon will remove the mon from the current box,
; else it will remove the mon from the party
-wMoveMonType:: ; cf95
+wMoveMonType:: ; cf94
; 0 = move from box to party
; 1 = move from party to box
; 2 = move from daycare to party
; 3 = move from party to daycare
ds 1
-wItemQuantity:: ; cf96
+wItemQuantity:: ; cf95
ds 1
-wMaxItemQuantity:: ; cf97
+wMaxItemQuantity:: ; cf96
ds 1
; LoadMonData copies mon data here
-wLoadedMon:: party_struct wLoadedMon ; cf98
+wLoadedMon:: party_struct wLoadedMon ; cf97
-wFontLoaded:: ; cfc4
+wFontLoaded:: ; cfc3
; bit 0: The space in VRAM that is used to store walk animation tile patterns
; for the player and NPCs is in use for font tile patterns.
; This means that NPC movement must be disabled.
; The other bits are unused.
ds 1
-wWalkCounter:: ; cfc5
+wWalkCounter:: ; cfc4
; walk animation counter
ds 1
-wTileInFrontOfPlayer:: ; cfc6
+wTileInFrontOfPlayer:: ; cfc5
; background tile number in front of the player (either 1 or 2 steps ahead)
ds 1
-wAudioFadeOutControl:: ; cfc7
+wAudioFadeOutControl:: ; cfc6
; The desired fade counter reload value is stored here prior to calling
; PlaySound in order to cause the current music to fade out before the new
; music begins playing. Storing 0 causes no fade out to occur and the new music
@@ -1527,13 +1789,13 @@ wAudioFadeOutControl:: ; cfc7
; audio, it zeroes this variable and starts playing the sound ID stored in it.
ds 1
-wAudioFadeOutCounterReloadValue:: ; cfc8
+wAudioFadeOutCounterReloadValue:: ; cfc7
ds 1
-wAudioFadeOutCounter:: ; cfc9
+wAudioFadeOutCounter:: ; cfc8
ds 1
-wLastMusicSoundID:: ; cfca
+wLastMusicSoundID:: ; cfc9
; This is used to determine whether the default music is already playing when
; attempting to play the default music (in order to avoid restarting the same
; music) and whether the music has already been stopped when attempting to
@@ -1545,110 +1807,140 @@ wLastMusicSoundID:: ; cfca
; the music).
ds 1
-wUpdateSpritesEnabled:: ; cfcb
+wUpdateSpritesEnabled:: ; cfca
; $00 = causes sprites to be hidden and the value to change to $ff
; $01 = enabled
; $ff = disabled
; other values aren't used
ds 1
-wEnemyMoveNum:: ; cfcc
+wEnemyMoveNum:: ; cfcb
ds 1
-wEnemyMoveEffect:: ; cfcd
+wEnemyMoveEffect:: ; cfcc
ds 1
-wEnemyMovePower:: ; cfce
+wEnemyMovePower:: ; cfcd
ds 1
-wEnemyMoveType:: ; cfcf
+wEnemyMoveType:: ; cfce
ds 1
-wEnemyMoveAccuracy:: ; cfd0
+wEnemyMoveAccuracy:: ; cfcf
ds 1
-wEnemyMoveMaxPP:: ; cfd1
+wEnemyMoveMaxPP:: ; cfd0
ds 1
-wPlayerMoveNum:: ; cfd2
+wPlayerMoveNum:: ; cfd1
ds 1
-wPlayerMoveEffect:: ; cfd3
+wPlayerMoveEffect:: ; cfd2
ds 1
-wPlayerMovePower:: ; cfd4
+wPlayerMovePower:: ; cfd3
ds 1
-wPlayerMoveType:: ; cfd5
+wPlayerMoveType:: ; cfd4
ds 1
-wPlayerMoveAccuracy:: ; cfd6
+wPlayerMoveAccuracy:: ; cfd5
ds 1
-wPlayerMoveMaxPP:: ; cfd7
+wPlayerMoveMaxPP:: ; cfd6
ds 1
-wEnemyMonSpecies2:: ; cfd8
+wEnemyMonSpecies2:: ; cfd7
ds 1
-wBattleMonSpecies2:: ; cfd9
+wBattleMonSpecies2:: ; cfd8
ds 1
-wEnemyMonNick:: ds NAME_LENGTH ; cfda
+wEnemyMonNick:: ds NAME_LENGTH ; cfd9
+
+wEnemyMon:: ; cfe4
+; The wEnemyMon struct reaches past 0xcfff,
+; the end of wram bank 0 on cgb.
+; This has no significance on dmg, where wram
+; isn't banked (c000-dfff is contiguous).
+; However, recent versions of rgbds have replaced
+; dmg-style wram with cgb wram banks.
+
+; Until this is fixed, this struct will have
+; to be declared manually.
-wEnemyMon:: battle_struct wEnemyMon ; cfe5
+wEnemyMonSpecies:: db
+wEnemyMonHP:: dw
+wEnemyMonPartyPos::
+wEnemyMonBoxLevel:: db
+wEnemyMonStatus:: db
+wEnemyMonType::
+wEnemyMonType1:: db
+wEnemyMonType2:: db
+wEnemyMonCatchRate_NotReferenced:: db
+wEnemyMonMoves:: ds NUM_MOVES
+wEnemyMonDVs:: ds 2
+wEnemyMonLevel:: db
+wEnemyMonMaxHP:: dw
+wEnemyMonAttack:: dw
+wEnemyMonDefense:: dw
+wEnemyMonSpeed:: dw
+wEnemyMonSpecial:: dw
+wEnemyMonPP:: ds 3 ; NUM_MOVES - 1
+SECTION "WRAM Bank 1", WRAMX
+ ds 1 ; NUM_MOVES - 3
wEnemyMonBaseStats:: ds 5
wEnemyMonActualCatchRate:: ds 1
wEnemyMonBaseExp:: ds 1
-wBattleMonNick:: ds NAME_LENGTH ; d009
-wBattleMon:: battle_struct wBattleMon ; d014
+wBattleMonNick:: ds NAME_LENGTH ; d008
+wBattleMon:: battle_struct wBattleMon ; d013
-wTrainerClass:: ; d031
+wTrainerClass:: ; d030
ds 1
ds 1
-wTrainerPicPointer:: ; d033
+wTrainerPicPointer:: ; d032
ds 2
ds 1
-wTempMoveNameBuffer:: ; d036
+wTempMoveNameBuffer:: ; d035
-wLearnMoveMonName:: ; d036
+wLearnMoveMonName:: ; d035
; The name of the mon that is learning a move.
ds 16
-wTrainerBaseMoney:: ; d046
+wTrainerBaseMoney:: ; d045
; 2-byte BCD number
; money received after battle = base money × level of highest-level enemy mon
ds 2
-wMissableObjectCounter:: ; d048
+wMissableObjectCounter:: ; d047
ds 1
ds 1
-wTrainerName:: ; d04a
+wTrainerName:: ; d049
; 13 bytes for the letters of the opposing trainer
; the name is terminated with $50 with possible
; unused trailing letters
ds 13
-wIsInBattle:: ; d057
+wIsInBattle:: ; d056
; lost battle, this is -1
; no battle, this is 0
; wild battle, this is 1
; trainer battle, this is 2
ds 1
-wPartyGainExpFlags:: ; d058
+wPartyGainExpFlags:: ; d057
; flags that indicate which party members should be be given exp when GainExperience is called
flag_array 6
-wCurOpponent:: ; d059
+wCurOpponent:: ; d058
; in a wild battle, this is the species of pokemon
; in a trainer battle, this is the trainer class + OPP_ID_OFFSET
ds 1
-wBattleType:: ; d05a
+wBattleType:: ; d059
; in normal battle, this is 0
; in old man battle, this is 1
; in safari battle, this is 2
ds 1
-wDamageMultipliers:: ; d05b
+wDamageMultipliers:: ; d05a
; bits 0-6: Effectiveness
; $0 = immune
; $5 = not very effective
@@ -1657,34 +1949,34 @@ wDamageMultipliers:: ; d05b
; bit 7: STAB
ds 1
-wLoneAttackNo:: ; d05c
+wLoneAttackNo:: ; d05b
; which entry in LoneAttacks to use
-wGymLeaderNo:: ; d05c
+wGymLeaderNo:: ; d05b
; it's actually the same thing as ^
ds 1
-wTrainerNo:: ; d05d
+wTrainerNo:: ; d05c
; which instance of [youngster, lass, etc] is this?
ds 1
-wCriticalHitOrOHKO:: ; d05e
+wCriticalHitOrOHKO:: ; d05d
; $00 = normal attack
; $01 = critical hit
; $02 = successful OHKO
; $ff = failed OHKO
ds 1
-wMoveMissed:: ; d05f
+wMoveMissed:: ; d05e
ds 1
-wPlayerStatsToDouble:: ; d060
+wPlayerStatsToDouble:: ; d05f
; always 0
ds 1
-wPlayerStatsToHalve:: ; d061
+wPlayerStatsToHalve:: ; d060
; always 0
ds 1
-wPlayerBattleStatus1:: ; d062
+wPlayerBattleStatus1:: ; d061
; bit 0 - bide
; bit 1 - thrash / petal dance
; bit 2 - attacking multiple times (e.g. double kick)
@@ -1695,7 +1987,7 @@ wPlayerBattleStatus1:: ; d062
; bit 7 - confusion
ds 1
-wPlayerBattleStatus2:: ; d063
+wPlayerBattleStatus2:: ; d062
; bit 0 - X Accuracy effect
; bit 1 - protected by "mist"
; bit 2 - focus energy effect
@@ -1705,106 +1997,104 @@ wPlayerBattleStatus2:: ; d063
; bit 7 - leech seeded
ds 1
-wPlayerBattleStatus3:: ; d064
+wPlayerBattleStatus3:: ; d063
; bit 0 - toxic
; bit 1 - light screen
; bit 2 - reflect
; bit 3 - transformed
ds 1
-wEnemyStatsToDouble:: ; d065
+wEnemyStatsToDouble:: ; d064
; always 0
ds 1
-wEnemyStatsToHalve:: ; d066
+wEnemyStatsToHalve:: ; d065
; always 0
ds 1
-wEnemyBattleStatus1:: ; d067
+wEnemyBattleStatus1:: ; d066
ds 1
-wEnemyBattleStatus2:: ; d068
+wEnemyBattleStatus2:: ; d067
ds 1
-wEnemyBattleStatus3:: ; d069
+wEnemyBattleStatus3:: ; d068
ds 1
-wPlayerNumAttacksLeft::
+wPlayerNumAttacksLeft:: ; d069
; when the player is attacking multiple times, the number of attacks left
ds 1
-wPlayerConfusedCounter:: ; d06b
+wPlayerConfusedCounter:: ; d06a
ds 1
-wPlayerToxicCounter:: ; d06c
+wPlayerToxicCounter:: ; d06b
ds 1
-
-wPlayerDisabledMove:: ; d06d
+wPlayerDisabledMove:: ; d06c
; high nibble: which move is disabled (1-4)
; low nibble: disable turns left
ds 1
ds 1
-wEnemyNumAttacksLeft:: ; d06f
+wEnemyNumAttacksLeft:: ; d06e
; when the enemy is attacking multiple times, the number of attacks left
ds 1
-wEnemyConfusedCounter:: ; d070
+wEnemyConfusedCounter:: ; d06f
ds 1
-wEnemyToxicCounter:: ; d071
+wEnemyToxicCounter:: ; d070
ds 1
-
-wEnemyDisabledMove:: ; d072
+wEnemyDisabledMove:: ; d071
; high nibble: which move is disabled (1-4)
; low nibble: disable turns left
ds 1
ds 1
-wPlayerNumHits:: ; d074
+wPlayerNumHits:: ; d073
; number of hits by player in attacks like Double Slap, etc.
-wPlayerBideAccumulatedDamage:: ; d074
+wPlayerBideAccumulatedDamage:: ; d073
; the amount of damage accumulated by the player while biding (2 bytes)
-wUnknownSerialCounter2:: ; d074
+wUnknownSerialCounter2:: ; d073
; 2 bytes
ds 4
-wEscapedFromBattle::
+wEscapedFromBattle:: ; d077
; non-zero when an item or move that allows escape from battle was used
ds 1
-wAmountMoneyWon:: ; d079
+wAmountMoneyWon:: ; d078
; 3-byte BCD number
-wObjectToHide:: ; d079
+wObjectToHide:: ; d078
ds 1
-wObjectToShow:: ; d07a
+wObjectToShow:: ; d079
ds 1
ds 1
-wDefaultMap:: ; d07c
+wDefaultMap:: ; d07b
; the map you will start at when the debug bit is set
-wMenuItemOffset:: ; d07c
+wMenuItemOffset:: ; d07b
-wAnimationID:: ; d07c
+wAnimationID:: ; d07b
; ID number of the current battle animation
ds 1
-wNamingScreenType:: ; d07d
+wNamingScreenType:: ; d07c
-wPartyMenuTypeOrMessageID:: ; d07d
+wPartyMenuTypeOrMessageID:: ; d07c
-wTempTilesetNumTiles:: ; d07d
+wTempTilesetNumTiles:: ; d07c
; temporary storage for the number of tiles in a tileset
ds 1
-wSavedListScrollOffset:: ; d07e
+wSavedListScrollOffset:: ; d07d
; used by the pokemart code to save the existing value of wListScrollOffset
; so that it can be restored when the player is done with the pokemart NPC
ds 1
@@ -1812,71 +2102,71 @@ wSavedListScrollOffset:: ; d07e
ds 2
; base coordinates of frame block
-wBaseCoordX:: ; d081
+wBaseCoordX:: ; d080
ds 1
-wBaseCoordY:: ; d082
+wBaseCoordY:: ; d081
ds 1
; low health alarm counter/enable
; high bit = enable, others = timer to cycle frequencies
-wLowHealthAlarm:: ds 1 ; d083
+wLowHealthAlarm:: ds 1 ; d082
-wFBTileCounter:: ; d084
+wFBTileCounter:: ; d083
; counts how many tiles of the current frame block have been drawn
ds 1
-wMovingBGTilesCounter2:: ; d085
+wMovingBGTilesCounter2:: ; d084
ds 1
-wSubAnimFrameDelay:: ; d086
+wSubAnimFrameDelay:: ; d085
; duration of each frame of the current subanimation in terms of screen refreshes
ds 1
-wSubAnimCounter:: ; d087
+wSubAnimCounter:: ; d086
; counts the number of subentries left in the current subanimation
ds 1
-wSaveFileStatus:: ; d088
+wSaveFileStatus:: ; d087
; 1 = no save file or save file is corrupted
; 2 = save file exists and no corruption has been detected
ds 1
-wNumFBTiles:: ; d089
+wNumFBTiles:: ; d088
; number of tiles in current battle animation frame block
ds 1
-wFlashScreenLongCounter:: ; d08a
+wFlashScreenLongCounter:: ; d089
-wSpiralBallsBaseY:: ; d08a
+wSpiralBallsBaseY:: ; d089
-wFallingObjectMovementByte:: ; d08a
+wFallingObjectMovementByte:: ; d089
; bits 0-6: index into FallingObjects_DeltaXs array (0 - 8)
; bit 7: direction; 0 = right, 1 = left
-wNumShootingBalls:: ; d08a
+wNumShootingBalls:: ; d089
-wTradedMonMovingRight:: ; d08a
+wTradedMonMovingRight:: ; d089
; $01 if mon is moving from left gameboy to right gameboy; $00 if vice versa
-wOptionsInitialized:: ; d08a
+wOptionsInitialized:: ; d089
-wNewSlotMachineBallTile:: ; d08a
+wNewSlotMachineBallTile:: ; d089
-wCoordAdjustmentAmount:: ; d08a
+wCoordAdjustmentAmount:: ; d089
; how much to add to the X/Y coord
-wUnusedD08A:: ; d08a
+wUnusedD08A:: ; d089
ds 1
-wSpiralBallsBaseX:: ; d08b
+wSpiralBallsBaseX:: ; d08a
-wNumFallingObjects:: ; d08b
+wNumFallingObjects:: ; d08a
-wSlideMonDelay:: ; d08b
+wSlideMonDelay:: ; d08a
-wAnimCounter:: ; d08b
+wAnimCounter:: ; d08a
; generic counter variable for various animations
-wSubAnimTransform:: ; d08b
+wSubAnimTransform:: ; d08a
; controls what transformations are applied to the subanimation
; 01: flip horizontally and vertically
; 02: flip horizontally and translate downwards 40 pixels
@@ -1884,52 +2174,52 @@ wSubAnimTransform:: ; d08b
; 04: reverse the subanimation
ds 1
-wEndBattleWinTextPointer:: ; d08c
+wEndBattleWinTextPointer:: ; d08b
ds 2
-wEndBattleLoseTextPointer:: ; d08e
+wEndBattleLoseTextPointer:: ; d08d
ds 2
ds 2
-wEndBattleTextRomBank:: ; d092
+wEndBattleTextRomBank:: ; d091
ds 1
ds 1
-wSubAnimAddrPtr:: ; d094
+wSubAnimAddrPtr:: ; d093
; the address _of the address_ of the current subanimation entry
ds 2
-wSlotMachineAllowMatchesCounter:: ; d096
+wSlotMachineAllowMatchesCounter:: ; d095
; If non-zero, the allow matches flag is always set.
; There is a 1/256 (~0.4%) chance that this value will be set to 60, which is
; the only way it can increase. Winning certain payout amounts will decrement it
; or zero it.
-wSubAnimSubEntryAddr:: ; d096
+wSubAnimSubEntryAddr:: ; d095
; the address of the current subentry of the current subanimation
ds 2
ds 2
-wOutwardSpiralTileMapPointer:: ; d09a
+wOutwardSpiralTileMapPointer:: ; d099
ds 1
-wPartyMenuAnimMonEnabled:: ; d09b
+wPartyMenuAnimMonEnabled:: ; d09a
-wTownMapSpriteBlinkingEnabled:: ; d09b
+wTownMapSpriteBlinkingEnabled:: ; d09a
; non-zero when enabled. causes nest locations to blink on and off.
; the town selection cursor will blink regardless of what this value is
-wUnusedD09B:: ; d09b
+wUnusedD09B:: ; d09a
ds 1
-wFBDestAddr:: ; d09c
+wFBDestAddr:: ; d09b
; current destination address in OAM for frame blocks (big endian)
ds 2
-wFBMode:: ; d09e
+wFBMode:: ; d09d
; controls how the frame blocks are put together to form frames
; specifically, after finishing drawing the frame block, the frame block's mode determines what happens
; 00: clean OAM buffer and delay
@@ -1938,173 +2228,172 @@ wFBMode:: ; d09e
; 04: delay, without cleaning OAM buffer, and do not advance [wFBDestAddr], so that the next frame block will overwrite this one
ds 1
-wLinkCableAnimBulgeToggle:: ; d09f
+wLinkCableAnimBulgeToggle:: ; d09e
; 0 = small
; 1 = big
-wIntroNidorinoBaseTile:: ; d09f
+wIntroNidorinoBaseTile:: ; d09e
-wOutwardSpiralCurrentDirection:: ; d09f
+wOutwardSpiralCurrentDirection:: ; d09e
-wDropletTile:: ; d09f
+wDropletTile:: ; d09e
-wNewTileBlockID:: ; d09f
+wNewTileBlockID:: ; d09e
-wWhichBattleAnimTileset:: ; d09f
+wWhichBattleAnimTileset:: ; d09e
-wSquishMonCurrentDirection:: ; d09f
+wSquishMonCurrentDirection:: ; d09e
; 0 = left
; 1 = right
-wSlideMonUpBottomRowLeftTile:: ; d09f
+wSlideMonUpBottomRowLeftTile:: ; d09e
; the tile ID of the leftmost tile in the bottom row in AnimationSlideMonUp_
ds 1
-wDisableVBlankWYUpdate:: ds 1 ; if non-zero, don't update WY during V-blank
+wDisableVBlankWYUpdate:: ds 1 ; if non-zero, don't update WY during V-blank ; d09f
-wSpriteCurPosX:: ; d0a1
+wSpriteCurPosX:: ; d0a0
ds 1
-wSpriteCurPosY:: ; d0a2
+wSpriteCurPosY:: ; d0a1
ds 1
-wSpriteWidth:: ; d0a3
+wSpriteWidth:: ; d0a2
ds 1
-wSpriteHeight:: ; d0a4
+wSpriteHeight:: ; d0a3
ds 1
-wSpriteInputCurByte:: ; d0a5
+wSpriteInputCurByte:: ; d0a4
; current input byte
ds 1
-wSpriteInputBitCounter:: ; d0a6
+wSpriteInputBitCounter:: ; d0a5
; bit offset of last read input bit
ds 1
-wSpriteOutputBitOffset:: ; d0a7; determines where in the output byte the two bits are placed. Each byte contains four columns (2bpp data)
+wSpriteOutputBitOffset:: ; d0a6; determines where in the output byte the two bits are placed. Each byte contains four columns (2bpp data)
; 3 -> XX000000 1st column
; 2 -> 00XX0000 2nd column
; 1 -> 0000XX00 3rd column
; 0 -> 000000XX 4th column
ds 1
-wSpriteLoadFlags:: ; d0a8
+wSpriteLoadFlags:: ; d0a7
; bit 0 determines used buffer (0 -> $a188, 1 -> $a310)
; bit 1 loading last sprite chunk? (there are at most 2 chunks per load operation)
ds 1
-wSpriteUnpackMode:: ; d0a9
+wSpriteUnpackMode:: ; d0a8
ds 1
-wSpriteFlipped:: ; d0aa
+wSpriteFlipped:: ; d0a9
ds 1
-wSpriteInputPtr:: ; d0ab
+wSpriteInputPtr:: ; d0aa
; pointer to next input byte
ds 2
-wSpriteOutputPtr:: ; d0ad
+wSpriteOutputPtr:: ; d0ac
; pointer to current output byte
ds 2
-wSpriteOutputPtrCached:: ; d0af
+wSpriteOutputPtrCached:: ; d0ae
; used to revert pointer for different bit offsets
ds 2
-wSpriteDecodeTable0Ptr:: ; d0b1
+wSpriteDecodeTable0Ptr:: ; d0b0
; pointer to differential decoding table (assuming initial value 0)
ds 2
-wSpriteDecodeTable1Ptr:: ; d0b3
+wSpriteDecodeTable1Ptr:: ; d0b2
; pointer to differential decoding table (assuming initial value 1)
ds 2
-wd0b5:: ds 1 ; used as a temp storage area for Pokemon Species, and other Pokemon/Battle related things
+wd0b5:: ds 1 ; used as a temp storage area for Pokemon Species, and other Pokemon/Battle related things ; d0b4
-wNameListType:: ; d0b6
+wNameListType:: ; d0b5
ds 1
-wPredefBank:: ; d0b7
+wPredefBank:: ; d0b6
ds 1
-wMonHeader:: ; d0b8
+wMonHeader:: ; d0b7
-wMonHIndex:: ; d0b8
+wMonHIndex:: ; d0b7
; In the ROM base stats data structure, this is the dex number, but it is
; overwritten with the internal index number after the header is copied to WRAM.
ds 1
-wMonHBaseStats:: ; d0b9
-wMonHBaseHP:: ; d0b9
+wMonHBaseStats:: ; d0b8
+wMonHBaseHP:: ; d0b8
ds 1
-wMonHBaseAttack:: ; d0ba
+wMonHBaseAttack:: ; d0b9
ds 1
-wMonHBaseDefense:: ; d0bb
+wMonHBaseDefense:: ; d0ba
ds 1
-wMonHBaseSpeed:: ; d0bc
+wMonHBaseSpeed:: ; d0bb
ds 1
-wMonHBaseSpecial:: ; d0bd
+wMonHBaseSpecial:: ; d0bc
ds 1
-wMonHTypes:: ; d0be
-wMonHType1:: ; d0be
+wMonHTypes:: ; d0bd
+wMonHType1:: ; d0bd
ds 1
-wMonHType2:: ; d0bf
+wMonHType2:: ; d0be
ds 1
-wMonHCatchRate:: ; d0c0
+wMonHCatchRate:: ; d0bf
ds 1
-wMonHBaseEXP:: ; d0c1
+wMonHBaseEXP:: ; d0c0
ds 1
-wMonHSpriteDim:: ; d0c2
+wMonHSpriteDim:: ; d0c1
ds 1
-wMonHFrontSprite:: ; d0c3
+wMonHFrontSprite:: ; d0c2
ds 2
-wMonHBackSprite:: ; d0c5
+wMonHBackSprite:: ; d0c4
ds 2
-wMonHMoves:: ; d0c7
- ds NUM_MOVES
+wMonHMoves:: ; d0c6
+ ds 4
-wMonHGrowthRate:: ; d0cb
+wMonHGrowthRate:: ; d0ca
ds 1
-wMonHLearnset:: ; d0cc
+wMonHLearnset:: ; d0cb
; bit field
flag_array 50 + 5
ds 1
-wSavedTilesetType:: ; d0d4
+wSavedTilesetType:: ; d0d3
; saved at the start of a battle and then written back at the end of the battle
ds 1
ds 2
-
-wDamage:: ; d0d7
+wDamage:: ; d0d6
ds 2
ds 2
-wRepelRemainingSteps:: ; d0db
+wRepelRemainingSteps:: ; d0da
ds 1
-wMoves:: ; d0dc
+wMoves:: ; d0db
; list of moves for FormatMovesString
ds 4
-wMoveNum:: ; d0e0
+wMoveNum:: ; d0df
ds 1
-wMovesString:: ; d0e1
+wMovesString:: ; d0e0
ds 56
-wUnusedD119:: ; d119
+wUnusedD119:: ; d118
ds 1
-wWalkBikeSurfStateCopy:: ; d11a
+wWalkBikeSurfStateCopy:: ; d119
; wWalkBikeSurfState is sometimes copied here, but it doesn't seem to be used for anything
ds 1
-wInitListType:: ; d11b
+wInitListType:: ; d11a
; the type of list for InitList to init
ds 1
-wCapturedMonSpecies:: ; d11c
+wCapturedMonSpecies:: ; d11b
; 0 if no mon was captured
ds 1
-wFirstMonsNotOutYet:: ; d11d
+wFirstMonsNotOutYet:: ; d11c
; Non-zero when the first player mon and enemy mon haven't been sent out yet.
; It prevents the game from asking if the player wants to choose another mon
; when the enemy sends out their first mon and suppresses the "no will to fight"
@@ -2116,73 +2405,74 @@ wPokeBallCaptureCalcTemp:: ; d11e
; lower nybble: number of shakes
; upper nybble: number of animations to play
-wPokeBallAnimData:: ; d11e
+wPokeBallAnimData:: ; d11d
-wUsingPPUp:: ; d11e
+wUsingPPUp:: ; d11d
-wMaxPP:: ; d11e
+wMaxPP:: ; d11d
; 0 for player, non-zero for enemy
-wCalculateWhoseStats:: ; d11e
+wCalculateWhoseStats:: ; d11d
-wTypeEffectiveness:: ; d11e
+wTypeEffectiveness:: ; d11d
-wMoveType:: ; d11e
+wMoveType:: ; d11d
-wNumSetBits:: ; d11e
+wNumSetBits:: ; d11d
wd11e:: ds 1 ; used as a Pokemon and Item storage value. Also used as an output value for CountSetBits
-wForcePlayerToChooseMon:: ; d11f
+wForcePlayerToChooseMon:: ; d11e
; When this value is non-zero, the player isn't allowed to exit the party menu
; by pressing B and not choosing a mon.
ds 1
-wNumRunAttempts::
+wNumRunAttempts:: ; d11f
; number of times the player has tried to run from battle
ds 1
-wEvolutionOccurred:: ; d121
+wEvolutionOccurred:: ; d120
ds 1
-wVBlankSavedROMBank:: ; d122
+wVBlankSavedROMBank:: ; d121
ds 1
+wFarCopyDataSavedROMBank:: ; d122
ds 1
-wIsKeyItem:: ; d124
+wIsKeyItem:: ; d123
ds 1
-wTextBoxID:: ; d125
+wTextBoxID:: ; d124
ds 1
-wCurrentMapScriptFlags:: ds 1 ; not exactly sure what this is used for, but it seems to be used as a multipurpose temp flag value
+wCurrentMapScriptFlags:: ds 1 ; not exactly sure what this is used for, but it seems to be used as a multipurpose temp flag value ; d125
-wCurEnemyLVL:: ; d127
+wCurEnemyLVL:: ; d126
ds 1
-wItemListPointer:: ; d128
+wItemListPointer:: ; d127
; pointer to list of items terminated by $FF
ds 2
-wListCount::
+wListCount:: ; d129
; number of entries in a list
ds 1
-wLinkState:: ; d12b
+wLinkState:: ; d12a
ds 1
-wTwoOptionMenuID:: ; d12c
+wTwoOptionMenuID:: ; d12b
ds 1
-wChosenMenuItem:: ; d12d
+wChosenMenuItem:: ; d12c
; the id of the menu item the player ultimately chose
-wOutOfBattleBlackout:: ; d12d
+wOutOfBattleBlackout:: ; d12c
; non-zero when the whole party has fainted due to out-of-battle poison damage
ds 1
-wMenuExitMethod:: ; d12e
+wMenuExitMethod:: ; d12d
; the way the user exited a menu
; for list menus and the buy/sell/quit menu:
; $01 = the user pressed A to choose a menu item
@@ -2192,147 +2482,148 @@ wMenuExitMethod:: ; d12e
; $02 = the user pressed B or pressed A with the second menu item selected
ds 1
-wDungeonWarpDataEntrySize:: ; d12f
+wDungeonWarpDataEntrySize:: ; d12e
; the size is always 6, so they didn't need a variable in RAM for this
-wWhichPewterGuy:: ; d12f
+wWhichPewterGuy:: ; d12e
; 0 = museum guy
; 1 = gym guy
-wWhichPrizeWindow:: ; d12f
+wWhichPrizeWindow:: ; d12e
; there are 3 windows, from 0 to 2
-wGymGateTileBlock:: ; d12f
+wGymGateTileBlock:: ; d12e
; a horizontal or vertical gate block
ds 1
-wSavedSpriteScreenY:: ; d130
+wSavedSpriteScreenY:: ; d12f
ds 1
-wSavedSpriteScreenX:: ; d131
+wSavedSpriteScreenX:: ; d130
ds 1
-wSavedSpriteMapY:: ; d132
+wSavedSpriteMapY:: ; d131
ds 1
-wSavedSpriteMapX:: ; d133
+wSavedSpriteMapX:: ; d132
ds 1
ds 5
-wWhichPrize:: ; d139
+wWhichPrize:: ; d138
ds 1
-wIgnoreInputCounter:: ; d13a
+wIgnoreInputCounter:: ; d139
; counts downward each frame
; when it hits 0, bit 5 (ignore input bit) of wd730 is reset
ds 1
-wStepCounter:: ; d13b
+wStepCounter:: ; d13a
; counts down once every step
ds 1
-wNumberOfNoRandomBattleStepsLeft:: ; d13c
+wNumberOfNoRandomBattleStepsLeft:: ; d13b
; after a battle, you have at least 3 steps before a random battle can occur
ds 1
-wPrize1:: ; d13d
+wPrize1:: ; d13c
ds 1
-wPrize2:: ; d13e
+wPrize2:: ; d13d
ds 1
-wPrize3:: ; d13f
+wPrize3:: ; d13e
ds 1
ds 1
-wSerialRandomNumberListBlock:: ; d141
+wSerialRandomNumberListBlock:: ; d140
; the first 7 bytes are the preamble
-wPrize1Price:: ; d141
+wPrize1Price:: ; d140
ds 2
-wPrize2Price:: ; d143
+wPrize2Price:: ; d142
ds 2
-wPrize3Price:: ; d145
+wPrize3Price:: ; d144
ds 2
ds 1
-wLinkBattleRandomNumberList:: ; d148
+wLinkBattleRandomNumberList:: ; d147
; shared list of 9 random numbers, indexed by wLinkBattleRandomNumberListIndex
ds 10
-wSerialPlayerDataBlock:: ; d152
+wSerialPlayerDataBlock:: ; d151
; the first 6 bytes are the preamble
-wPseudoItemID:: ; d152
+wPseudoItemID:: ; d151
; When a real item is being used, this is 0.
; When a move is acting as an item, this is the ID of the item it's acting as.
; For example, out-of-battle Dig is executed using a fake Escape Rope item. In
; that case, this would be ESCAPE_ROPE.
ds 1
-wUnusedD153:: ; d153
+wUnusedD153:: ; d152
ds 1
ds 2
-wEvoStoneItemID:: ; d156
+wEvoStoneItemID:: ; d155
ds 1
-wSavedNPCMovementDirections2Index:: ; d157
+wSavedNPCMovementDirections2Index:: ; d156
ds 1
-wPlayerName:: ; d158
+wPlayerName:: ; d157
ds NAME_LENGTH
wPartyDataStart::
-wPartyCount:: ds 1 ; d163
-wPartySpecies:: ds PARTY_LENGTH ; d164
-wPartyEnd:: ds 1 ; d16a
+wPartyCount:: ds 1 ; d162
+wPartySpecies:: ds PARTY_LENGTH ; d163
+wPartyEnd:: ds 1 ; d169
wPartyMons::
-wPartyMon1:: party_struct wPartyMon1 ; d16b
-wPartyMon2:: party_struct wPartyMon2 ; d197
-wPartyMon3:: party_struct wPartyMon3 ; d1c3
-wPartyMon4:: party_struct wPartyMon4 ; d1ef
-wPartyMon5:: party_struct wPartyMon5 ; d21b
-wPartyMon6:: party_struct wPartyMon6 ; d247
+wPartyMon1:: party_struct wPartyMon1 ; d16a
+wPartyMon2:: party_struct wPartyMon2 ; d196
+wPartyMon3:: party_struct wPartyMon3 ; d1c2
+wPartyMon4:: party_struct wPartyMon4 ; d1ee
+wPartyMon5:: party_struct wPartyMon5 ; d21a
+wPartyMon6:: party_struct wPartyMon6 ; d246
-wPartyMonOT:: ds NAME_LENGTH * PARTY_LENGTH ; d273
-wPartyMonNicks:: ds NAME_LENGTH * PARTY_LENGTH ; d2b5
+wPartyMonOT:: ds NAME_LENGTH * PARTY_LENGTH ; d272
+wPartyMonNicks:: ds NAME_LENGTH * PARTY_LENGTH ; d2b4
+wPartyMonNicksEnd::
wPartyDataEnd::
wMainDataStart::
-wPokedexOwned:: ; d2f7
+wPokedexOwned:: ; d2f5
flag_array NUM_POKEMON
wPokedexOwnedEnd::
-wPokedexSeen:: ; d30a
+wPokedexSeen:: ; d309
flag_array NUM_POKEMON
wPokedexSeenEnd::
-wNumBagItems:: ; d31d
+wNumBagItems:: ; d31c
ds 1
-wBagItems:: ; d31e
+wBagItems:: ; d31d
; item, quantity
ds BAG_ITEM_CAPACITY * 2
ds 1 ; end
-wPlayerMoney:: ; d347
+wPlayerMoney:: ; d346
ds 3 ; BCD
-wRivalName:: ; d34a
+wRivalName:: ; d349
ds NAME_LENGTH
-wOptions:: ; d355
+wOptions:: ; d354
; bit 7 = battle animation
; 0: On
; 1: Off
@@ -2345,553 +2636,647 @@ wOptions:: ; d355
; 5: Slow
ds 1
-wObtainedBadges:: ; d356
+wObtainedBadges:: ; d355
flag_array 8
ds 1
-wLetterPrintingDelayFlags:: ; d358
+wLetterPrintingDelayFlags:: ; d357
; bit 0: If 0, limit the delay to 1 frame. Note that this has no effect if
; the delay has been disabled entirely through bit 1 of this variable
; or bit 6 of wd730.
; bit 1: If 0, no delay.
ds 1
-wPlayerID:: ; d359
+wPlayerID:: ; d358
ds 2
-wMapMusicSoundID:: ; d35b
+wMapMusicSoundID:: ; d35a
ds 1
-wMapMusicROMBank:: ; d35c
+wMapMusicROMBank:: ; d35b
ds 1
-wMapPalOffset:: ; d35d
+wMapPalOffset:: ; d35c
; offset subtracted from FadePal4 to get the background and object palettes for the current map
; normally, it is 0. it is 6 when Flash is needed, causing FadePal2 to be used instead of FadePal4
ds 1
-wCurMap:: ; d35e
+wCurMap:: ; d35d
ds 1
-wCurrentTileBlockMapViewPointer:: ; d35f
+wCurrentTileBlockMapViewPointer:: ; d35e
; pointer to the upper left corner of the current view in the tile block map
ds 2
-wYCoord:: ; d361
+wYCoord:: ; d360
; player’s position on the current map
ds 1
-wXCoord:: ; d362
+wXCoord:: ; d361
ds 1
-wYBlockCoord:: ; d363
+wYBlockCoord:: ; d362
; player's y position (by block)
ds 1
-wXBlockCoord:: ; d364
+wXBlockCoord:: ; d363
ds 1
-wLastMap:: ; d365
+wLastMap:: ; d364
ds 1
-wUnusedD366:: ; d366
+wUnusedD366:: ; d365
ds 1
-wCurMapTileset:: ; d367
+wCurMapTileset:: ; d366
ds 1
-wCurMapHeight:: ; d368
+wCurMapHeight:: ; d367
; blocks
ds 1
-wCurMapWidth:: ; d369
+wCurMapWidth:: ; d368
; blocks
ds 1
-wMapDataPtr:: ; d36a
+wMapDataPtr:: ; d369
ds 2
-wMapTextPtr:: ; d36c
+wMapTextPtr:: ; d36b
ds 2
-wMapScriptPtr:: ; d36e
+wMapScriptPtr:: ; d36d
ds 2
-wMapConnections:: ; d370
+wMapConnections:: ; d36f
; connection byte
ds 1
-wMapConn1Ptr:: ; d371
+wMapConn1Ptr:: ; d370
ds 1
-wNorthConnectionStripSrc:: ; d372
+wNorthConnectionStripSrc:: ; d371
ds 2
-wNorthConnectionStripDest:: ; d374
+wNorthConnectionStripDest:: ; d373
ds 2
-wNorthConnectionStripWidth:: ; d376
+wNorthConnectionStripWidth:: ; d375
ds 1
-wNorthConnectedMapWidth:: ; d377
+wNorthConnectedMapWidth:: ; d376
ds 1
-wNorthConnectedMapYAlignment:: ; d378
+wNorthConnectedMapYAlignment:: ; d377
ds 1
-wNorthConnectedMapXAlignment:: ; d379
+wNorthConnectedMapXAlignment:: ; d378
ds 1
-wNorthConnectedMapViewPointer:: ; d37a
+wNorthConnectedMapViewPointer:: ; d379
ds 2
-wMapConn2Ptr:: ; d37c
+wMapConn2Ptr:: ; d37b
ds 1
-wSouthConnectionStripSrc:: ; d37d
+wSouthConnectionStripSrc:: ; d37c
ds 2
-wSouthConnectionStripDest:: ; d37f:
+wSouthConnectionStripDest:: ; d37e
ds 2
-wSouthConnectionStripWidth:: ; d381
+wSouthConnectionStripWidth:: ; d380
ds 1
-wSouthConnectedMapWidth:: ; d382
+wSouthConnectedMapWidth:: ; d381
ds 1
-wSouthConnectedMapYAlignment:: ; d383
+wSouthConnectedMapYAlignment:: ; d382
ds 1
-wSouthConnectedMapXAlignment:: ; d384
+wSouthConnectedMapXAlignment:: ; d383
ds 1
-wSouthConnectedMapViewPointer:: ; d385
+wSouthConnectedMapViewPointer:: ; d384
ds 2
-wMapConn3Ptr:: ; d387
+wMapConn3Ptr:: ; d386
ds 1
-wWestConnectionStripSrc:: ; d388
+wWestConnectionStripSrc:: ; d387
ds 2
-wWestConnectionStripDest:: ; d38a
+wWestConnectionStripDest:: ; d389
ds 2
-wWestConnectionStripHeight:: ; d38c
+wWestConnectionStripHeight:: ; d38b
ds 1
-wWestConnectedMapWidth:: ; d38d
+wWestConnectedMapWidth:: ; d38c
ds 1
-wWestConnectedMapYAlignment:: ; d38e
+wWestConnectedMapYAlignment:: ; d38d
ds 1
-wWestConnectedMapXAlignment:: ; d38f
+wWestConnectedMapXAlignment:: ; d38e
ds 1
-wWestConnectedMapViewPointer:: ; d390
+wWestConnectedMapViewPointer:: ; d38f
ds 2
-wMapConn4Ptr:: ; d392
+wMapConn4Ptr:: ; d391
ds 1
-wEastConnectionStripSrc:: ; d393
+wEastConnectionStripSrc:: ; d392
ds 2
-wEastConnectionStripDest:: ; d395
+wEastConnectionStripDest:: ; d394
ds 2
-wEastConnectionStripHeight:: ; d397
+wEastConnectionStripHeight:: ; d396
ds 1
-wEastConnectedMapWidth:: ; d398
+wEastConnectedMapWidth:: ; d397
ds 1
-wEastConnectedMapYAlignment:: ; d399
+wEastConnectedMapYAlignment:: ; d398
ds 1
-wEastConnectedMapXAlignment:: ; d39a
+wEastConnectedMapXAlignment:: ; d399
ds 1
-wEastConnectedMapViewPointer:: ; d39b
+wEastConnectedMapViewPointer:: ; d39a
ds 2
-wSpriteSet:: ; d39d
+wSpriteSet:: ; d39c
; sprite set for the current map (11 sprite picture ID's)
ds 11
-wSpriteSetID:: ; d3a8
+wSpriteSetID:: ; d3a7
; sprite set ID for the current map
ds 1
-wObjectDataPointerTemp:: ; d3a9
+wObjectDataPointerTemp:: ; d3a8
ds 2
ds 2
-wMapBackgroundTile:: ; d3ad
+wMapBackgroundTile:: ; d3ac
; the tile shown outside the boundaries of the map
ds 1
-wNumberOfWarps:: ; d3ae
+wNumberOfWarps:: ; d3ad
; number of warps in current map
ds 1
-wWarpEntries:: ; d3af
+wWarpEntries:: ; d3ae
; current map warp entries
ds 128
-wDestinationWarpID:: ; d42f
+wDestinationWarpID:: ; d42e
; if $ff, the player's coordinates are not updated when entering the map
ds 1
- ds 128
+wPikachuOverworldStateFlags:: ds 1 ; d42f
+wPikachuSpawnState:: ds 1 ; d430
+wd432:: ds 1 ; d431
+wd433:: ds 1 ; d432
+wd434:: ds 1 ; d433
+wd435:: ds 1 ; d434
+wd436:: ds 1 ; d435
+wPikachuFollowCommandBufferSize:: ds 1 ; d436
+wPikachuFollowCommandBuffer:: ds 16 ; d437
+
+wExpressionNumber:: ; d447
+ ds 1
+wPikaPicAnimNumber:: ; d448
+ ds 1
+
+wPikachuMovementScriptBank:: ds 1 ; d449
+wPikachuMovementScriptAddress:: dw ; d44a
+wPikachuMovementFlags:: ; d44c
+; bit 6 - spawn shadow
+; bit 7 - signal end of command
+ ds 1
+
+UNION
+
+wCurPikaMovementData:: ; d44d
+wCurPikaMovementParam1:: ds 1 ; d44d
+wCurPikaMovementFunc1:: ds 1 ; d44e
+wCurPikaMovementParam2:: ds 1 ; d44f
+wCurPikaMovementFunc2:: ds 1 ; d450
+wd451:: ds 1 ; d451
+wCurPikaMovementSpriteImageIdx:: ds 1 ; d452
+wPikaSpriteX:: ds 1 ; d453
+wPikaSpriteY:: ds 1 ; d454
+wPikachuMovementXOffset:: ds 1 ; d455
+wPikachuMovementYOffset:: ds 1 ; d456
+wPikachuStepTimer:: ds 1 ; d457
+wPikachuStepSubtimer:: ds 1 ; d458
+ ds 5
+wCurPikaMovementDataEnd:: ; d45e
+
+NEXTU
+
+wPikaPicAnimPointer:: dw ; d44d
+wPikaPicAnimPointerSetupFinished:: ds 1 ; d44f
+wPikaPicAnimCurGraphicID:: ds 1 ; d450
+wPikaPicAnimTimer:: ds 2 ; d451
+wPikaPicAnimDelay:: ds 1 ; d453
+wPikaPicPikaDrawStartX:: ds 1 ; d454
+wPikaPicPikaDrawStartY:: ds 1 ; d455
+
+wCurPikaPicAnimObject:: ; d456
+wCurPikaPicAnimObjectVTileOffset:: db ; d456
+wCurPikaPicAnimObjectXOffset:: db ; d457
+wCurPikaPicAnimObjectYOffset:: db ; d458
+wCurPikaPicAnimObjectScriptIdx:: db ; d459
+wCurPikaPicAnimObjectFrameIdx:: db ; d45a
+wCurPikaPicAnimObjectFrameTimer:: db ; d45b
+ ds 1
+wCurPikaPicAnimObjectEnd:: ; d45d
+
+ ds 18
+ENDU
+
+wPikachuHappiness:: ds 1 ; d46f
+wPikachuMood:: ds 1 ; d470
+wd472:: ds 1 ; d471
+wd473:: ds 1 ; d472
+
+ ds 1
-wNumSigns:: ; d4b0
+wd475:: ds 1 ; d474
+
+ ds 4
+
+wd47a:: ds 1 ; d479
+
+ ds 24
+
+wd492:: ds 1 ; d492
+
+ ds 1
+
+wSurfingMinigameHiScore:: ds 2 ; 4-digit BCD little-endian
+ ds 1
+
+wPrinterSettings:: ds 1
+wUnknownSerialFlag_d499:: ds 1 ; d498
+wPrinterConnectionOpen:: ds 1 ; d499
+wPrinterOpcode:: ds 1 ; d49a
+wd49c:: ds 1 ; d49b
+
+ ds 19
+
+wNumSigns:: ; d4af
; number of signs in the current map (up to 16)
ds 1
-wSignCoords:: ; d4b1
+wSignCoords:: ; d4b0
; 2 bytes each
; Y, X
ds 32
-wSignTextIDs:: ; d4d1
+wSignTextIDs:: ; d4d0
ds 16
-wNumSprites:: ; d4e1
+wNumSprites:: ; d4e0
; number of sprites on the current map
ds 1
; these two variables track the X and Y offset in blocks from the last special warp used
; they don't seem to be used for anything
-wYOffsetSinceLastSpecialWarp:: ; d4e2
+wYOffsetSinceLastSpecialWarp:: ; d4e1
ds 1
-wXOffsetSinceLastSpecialWarp:: ; d4e3
+wXOffsetSinceLastSpecialWarp:: ; d4e2
ds 1
-wMapSpriteData:: ; d4e4
+wMapSpriteData:: ; d4e3
; two bytes per sprite (movement byte 2, text ID)
ds 32
-wMapSpriteExtraData:: ; d504
+wMapSpriteExtraData:: ; d503
; two bytes per sprite (trainer class/item ID, trainer set ID)
ds 32
-wCurrentMapHeight2:: ; d524
+wCurrentMapHeight2:: ; d523
; map height in 2x2 meta-tiles
ds 1
-wCurrentMapWidth2:: ; d525
+wCurrentMapWidth2:: ; d524
; map width in 2x2 meta-tiles
ds 1
-wMapViewVRAMPointer:: ; d526
+wMapViewVRAMPointer:: ; d525
; the address of the upper left corner of the visible portion of the BG tile map in VRAM
ds 2
; In the comments for the player direction variables below, "moving" refers to
; both walking and changing facing direction without taking a step.
-wPlayerMovingDirection:: ; d528
+wPlayerMovingDirection:: ; d527
; if the player is moving, the current direction
; if the player is not moving, zero
; map scripts write to this in order to change the player's facing direction
ds 1
-wPlayerLastStopDirection:: ; d529
+wPlayerLastStopDirection:: ; d528
; the direction in which the player was moving before the player last stopped
ds 1
-wPlayerDirection:: ; d52a
+wPlayerDirection:: ; d529
; if the player is moving, the current direction
; if the player is not moving, the last the direction in which the player moved
ds 1
-wTilesetBank:: ; d52b
+wTilesetBank:: ; d52a
ds 1
-wTilesetBlocksPtr:: ; d52c
+wTilesetBlocksPtr:: ; d52b
; maps blocks (4x4 tiles) to tiles
ds 2
-wTilesetGfxPtr:: ; d52e
+wTilesetGfxPtr:: ; d52d
ds 2
-wTilesetCollisionPtr:: ; d530
+wTilesetCollisionPtr:: ; d52f
; list of all walkable tiles
ds 2
-wTilesetTalkingOverTiles:: ; d532
+wTilesetTalkingOverTiles:: ; d531
ds 3
-wGrassTile:: ; d535
+wGrassTile:: ; d534
ds 1
ds 4
-wNumBoxItems:: ; d53a
+wNumBoxItems:: ; d539
ds 1
-wBoxItems:: ; d53b
+wBoxItems:: ; d53a
; item, quantity
ds PC_ITEM_CAPACITY * 2
ds 1 ; end
-wCurrentBoxNum:: ; d5a0
+wCurrentBoxNum:: ; d59f
; bits 0-6: box number
; bit 7: whether the player has changed boxes before
ds 2
-wNumHoFTeams:: ; d5a2
+wNumHoFTeams:: ; d5a1
; number of HOF teams
ds 1
-wUnusedD5A3:: ; d5a3
+wUnusedD5A3:: ; d5a2
ds 1
-wPlayerCoins:: ; d5a4
+wPlayerCoins:: ; d5a3
ds 2 ; BCD
-wMissableObjectFlags:: ; d5a6
+wMissableObjectFlags:: ; d5a5
; bit array of missable objects. set = removed
ds 32
-wMissableObjectFlagsEnd::
+wMissableObjectFlagsEnd:: ; d5c5
ds 7
-wd5cd:: ds 1 ; temp copy of c1x2 (sprite facing/anim)
+wd5cd:: ds 1 ; temp copy of c1x2 (sprite facing/anim) ; d5cc
-wMissableObjectList:: ; d5ce
+wMissableObjectList:: ; d5cd
; each entry consists of 2 bytes
; * the sprite ID (depending on the current map)
; * the missable object index (global, used for wMissableObjectFlags)
; terminated with $FF
ds 17 * 2
-wGameProgressFlags:: ; d5f0
+wGameProgressFlags:: ; d5e9
; $c8 bytes
-wOaksLabCurScript:: ; d5f0
+wOaksLabCurScript:: ; d5e9
ds 1
-wPalletTownCurScript:: ; d5f1
+wPalletTownCurScript:: ; d5f0
ds 1
ds 1
-wBluesHouseCurScript:: ; d5f3
+wBluesHouseCurScript:: ; d5f2
ds 1
-wViridianCityCurScript:: ; d5f4
+wViridianCityCurScript:: ; d5f3
ds 1
ds 2
-wPewterCityCurScript:: ; d5f7
+wPewterCityCurScript:: ; d5f6
ds 1
-wRoute3CurScript:: ; d5f8
+wRoute3CurScript:: ; d5f7
ds 1
-wRoute4CurScript:: ; d5f9
+wRoute4CurScript:: ; d5f8
ds 1
+wFanClubCurScript:: ; d5f9
ds 1
-wViridianGymCurScript:: ; d5fb
+wViridianGymCurScript:: ; d5fa
ds 1
-wPewterGymCurScript:: ; d5fc
+wPewterGymCurScript:: ; d5fb
ds 1
-wCeruleanGymCurScript:: ; d5fd
+wCeruleanGymCurScript:: ; d5fc
ds 1
-wVermilionGymCurScript:: ; d5fe
+wVermilionGymCurScript:: ; d5fd
ds 1
-wCeladonGymCurScript:: ; d5ff
+wCeladonGymCurScript:: ; d5fe
ds 1
-wRoute6CurScript:: ; d600
+wRoute6CurScript:: ; d5ff
ds 1
-wRoute8CurScript:: ; d601
+wRoute8CurScript:: ; d600
ds 1
-wRoute24CurScript:: ; d602
+wRoute24CurScript:: ; d601
ds 1
-wRoute25CurScript:: ; d603
+wRoute25CurScript:: ; d602
ds 1
-wRoute9CurScript:: ; d604
+wRoute9CurScript:: ; d603
ds 1
-wRoute10CurScript:: ; d605
+wRoute10CurScript:: ; d604
ds 1
-wMtMoon1FCurScript:: ; d606
+wMtMoon1FCurScript:: ; d605
ds 1
-wMtMoonB2FCurScript:: ; d607
+wMtMoonB2FCurScript:: ; d606
ds 1
-wSSAnne1FRoomsCurScript:: ; d608
+wSSAnne1FRoomsCurScript:: ; d607
ds 1
-wSSAnne2FRoomsCurScript:: ; d609
+wSSAnne2FRoomsCurScript:: ; d608
ds 1
-wRoute22CurScript:: ; d60a
+wRoute22CurScript:: ; d609
ds 1
ds 1
-wRedsHouse2FCurScript:: ; d60c
+wRedsHouse2FCurScript:: ; d60b
ds 1
-wViridianMartCurScript:: ; d60d
+wViridianMartCurScript:: ; d60c
ds 1
-wRoute22GateCurScript:: ; d60e
+wRoute22GateCurScript:: ; d60d
ds 1
-wCeruleanCityCurScript:: ; d60f
+wCeruleanCityCurScript:: ; d60e
ds 1
ds 7
-wSSAnneBowCurScript:: ; d617
+wSSAnneBowCurScript:: ; d616
ds 1
-wViridianForestCurScript:: ; d618
+wViridianForestCurScript:: ; d617
ds 1
-wMuseum1FCurScript:: ; d619
+wMuseum1FCurScript:: ; d618
ds 1
-wRoute13CurScript:: ; d61a
+wRoute13CurScript:: ; d619
ds 1
-wRoute14CurScript:: ; d61b
+wRoute14CurScript:: ; d61a
ds 1
-wRoute17CurScript:: ; d61c
+wRoute17CurScript:: ; d61b
ds 1
-wRoute19CurScript:: ; d61d
+wRoute19CurScript:: ; d61c
ds 1
-wRoute21CurScript:: ; d61e
+wRoute21CurScript:: ; d61d
ds 1
-wSafariZoneGateCurScript:: ; d61f
+wSafariZoneGateCurScript:: ; d61e
ds 1
-wRockTunnelB1FCurScript:: ; d620
+wRockTunnelB1FCurScript:: ; d61f
ds 1
-wRockTunnel1FCurScript:: ; d621
+wRockTunnel1FCurScript:: ; d620
ds 1
ds 1
-wRoute11CurScript:: ; d623
+wRoute11CurScript:: ; d622
ds 1
-wRoute12CurScript:: ; d624
+wRoute12CurScript:: ; d623
ds 1
-wRoute15CurScript:: ; d625
+wRoute15CurScript:: ; d624
ds 1
-wRoute16CurScript:: ; d626
+wRoute16CurScript:: ; d625
ds 1
-wRoute18CurScript:: ; d627
+wRoute18CurScript:: ; d626
ds 1
-wRoute20CurScript:: ; d628
+wRoute20CurScript:: ; d627
ds 1
-wSSAnneB1FRoomsCurScript:: ; d629
+wSSAnneB1FRoomsCurScript:: ; d628
ds 1
-wVermilionCityCurScript:: ; d62a
+wVermilionCityCurScript:: ; d629
ds 1
-wPokemonTower2FCurScript:: ; d62b
+wPokemonTower2FCurScript:: ; d62a
ds 1
-wPokemonTower3FCurScript:: ; d62c
+wPokemonTower3FCurScript:: ; d62b
ds 1
-wPokemonTower4FCurScript:: ; d62d
+wPokemonTower4FCurScript:: ; d62c
ds 1
-wPokemonTower5FCurScript:: ; d62e
+wPokemonTower5FCurScript:: ; d62d
ds 1
-wPokemonTower6FCurScript:: ; d62f
+wPokemonTower6FCurScript:: ; d62e
ds 1
-wPokemonTower7FCurScript:: ; d630
+wPokemonTower7FCurScript:: ; d62f
ds 1
-wRocketHideoutB1FCurScript:: ; d631
+wRocketHideoutB1FCurScript:: ; d630
ds 1
-wRocketHideoutB2FCurScript:: ; d632
+wRocketHideoutB2FCurScript:: ; d631
ds 1
-wRocketHideoutB3FCurScript:: ; d633
+wRocketHideoutB3FCurScript:: ; d632
ds 1
-wRocketHideoutB4FCurScript:: ; d634
+wRocketHideoutB4FCurScript:: ; d633
ds 2
-wRoute6GateCurScript:: ; d636
+wRoute6GateCurScript:: ; d635
ds 1
-wRoute8GateCurScript:: ; d637
+wRoute8GateCurScript:: ; d636
ds 2
-wCinnabarIslandCurScript:: ; d639
+wCinnabarIslandCurScript:: ; d638
ds 1
-wPokemonMansion1FCurScript:: ; d63a
+wPokemonMansion1FCurScript:: ; d639
ds 2
-wPokemonMansion2FCurScript:: ; d63c
+wPokemonMansion2FCurScript:: ; d63b
ds 1
-wPokemonMansion3FCurScript:: ; d63d
+wPokemonMansion3FCurScript:: ; d63c
ds 1
-wPokemonMansionB1FCurScript:: ; d63e
+wPokemonMansionB1FCurScript:: ; d63d
ds 1
-wVictoryRoad2FCurScript:: ; d63f
+wVictoryRoad2FCurScript:: ; d63e
ds 1
-wVictoryRoad3FCurScript:: ; d640
- ds 2
-wFightingDojoCurScript:: ; d642
+wVictoryRoad3FCurScript:: ; d63f
ds 1
-wSilphCo2FCurScript:: ; d643
+wCeladonCityCurScript:: ; d640
ds 1
-wSilphCo3FCurScript:: ; d644
+wFightingDojoCurScript:: ; d641
ds 1
-wSilphCo4FCurScript:: ; d645
+wSilphCo2FCurScript:: ; d642
ds 1
-wSilphCo5FCurScript:: ; d646
+wSilphCo3FCurScript:: ; d643
ds 1
-wSilphCo6FCurScript:: ; d647
+wSilphCo4FCurScript:: ; d644
ds 1
-wSilphCo7FCurScript:: ; d648
+wSilphCo5FCurScript:: ; d645
ds 1
-wSilphCo8FCurScript:: ; d649
+wSilphCo6FCurScript:: ; d646
ds 1
-wSilphCo9FCurScript:: ; d64a
+wSilphCo7FCurScript:: ; d647
ds 1
-wHallOfFameCurScript:: ; d64b
+wSilphCo8FCurScript:: ; d648
ds 1
-wChampionsRoomCurScript:: ; d64c
+wSilphCo9FCurScript:: ; d649
ds 1
-wLoreleisRoomCurScript:: ; d64d
+wHallOfFameCurScript:: ; d64a
ds 1
-wBrunosRoomCurScript:: ; d64e
+wChampionsRoomCurScript:: ; d64b
ds 1
-wAgathasRoomCurScript:: ; d64f
+wLoreleisRoomCurScript:: ; d64c
ds 1
-wCeruleanCaveB1FCurScript:: ; d650
+wBrunosRoomCurScript:: ; d64d
ds 1
-wVictoryRoad1FCurScript:: ; d651
+wAgathasRoomCurScript:: ; d64e
ds 1
+wCeruleanCaveB1FCurScript:: ; d64f
ds 1
-wLancesRoomCurScript:: ; d653
+wVictoryRoad1FCurScript:: ; d650
+ ds 1
+ ds 1
+wLancesRoomCurScript:: ; d652
ds 1
ds 4
-wSilphCo10FCurScript:: ; d658
+wSilphCo10FCurScript:: ; d657
ds 1
-wSilphCo11FCurScript:: ; d659
+wSilphCo11FCurScript:: ; d658
ds 1
ds 1
-wFuchsiaGymCurScript:: ; d65b
+wFuchsiaGymCurScript:: ; d65a
ds 1
-wSaffronGymCurScript:: ; d65c
+wSaffronGymCurScript:: ; d65b
ds 1
ds 1
-wCinnabarGymCurScript:: ; d65e
+wCinnabarGymCurScript:: ; d65d
ds 1
-wGameCornerCurScript:: ; d65f
+wGameCornerCurScript:: ; d65e
ds 1
-wRoute16Gate1FCurScript:: ; d660
+wRoute16Gate1FCurScript:: ; d65f
ds 1
-wBillsHouseCurScript:: ; d661
+wBillsHouseCurScript:: ; d660
ds 1
-wRoute5GateCurScript:: ; d662
+wRoute5GateCurScript:: ; d661
ds 1
-wPowerPlantCurScript:: ; d663
-wRoute7GateCurScript:: ; d663
+wPowerPlantCurScript:: ; d662
+wRoute7GateCurScript:: ; d662
; overload
ds 1
ds 1
-wSSAnne2FCurScript:: ; d665
+wSSAnne2FCurScript:: ; d664
ds 1
-wSeafoamIslandsB3FCurScript:: ; d666
+wSeafoamIslandsB3FCurScript:: ; d665
ds 1
-wRoute23CurScript:: ; d667
+wRoute23CurScript:: ; d666
ds 1
-wSeafoamIslandsB4FCurScript:: ; d668
+wSeafoamIslandsB4FCurScript:: ; d667
ds 1
-wRoute18Gate1FCurScript:: ; d669
+wRoute18Gate1FCurScript:: ; d668
ds 1
ds 78
-wGameProgressFlagsEnd::
+wGameProgressFlagsEnd:: ; d6b7
ds 56
-wObtainedHiddenItemsFlags::
+wObtainedHiddenItemsFlags:: ; d6ef
ds 14
-wObtainedHiddenCoinsFlags::
+wObtainedHiddenCoinsFlags:: ; d6fd
ds 2
-wWalkBikeSurfState:: ; d700
+wWalkBikeSurfState:: ; d6ff
; $00 = walking
; $01 = biking
; $02 = surfing
@@ -2899,71 +3284,71 @@ wWalkBikeSurfState:: ; d700
ds 10
-wTownVisitedFlag:: ; d70b
+wTownVisitedFlag:: ; d70a
flag_array 13
-wSafariSteps:: ; d70d
+wSafariSteps:: ; d70c
; starts at 502
ds 2
-wFossilItem:: ; d70f
+wFossilItem:: ; d70e
; item given to cinnabar lab
ds 1
-wFossilMon:: ; d710
+wFossilMon:: ; d70f
; mon that will result from the item
ds 1
ds 2
-wEnemyMonOrTrainerClass:: ; d713
+wEnemyMonOrTrainerClass:: ; d712
; trainer classes start at OPP_ID_OFFSET
ds 1
-wPlayerJumpingYScreenCoordsIndex:: ; d714
+wPlayerJumpingYScreenCoordsIndex:: ; d713
ds 1
-wRivalStarter:: ; d715
+wRivalStarter:: ; d714
ds 1
ds 1
-wPlayerStarter:: ; d717
+wPlayerStarter:: ; d716
ds 1
-wBoulderSpriteIndex:: ; d718
+wBoulderSpriteIndex:: ; d717
; sprite index of the boulder the player is trying to push
ds 1
-wLastBlackoutMap:: ; d719
+wLastBlackoutMap:: ; d718
ds 1
-wDestinationMap:: ; d71a
+wDestinationMap:: ; d719
; destination map (for certain types of special warps, not ordinary walking)
ds 1
-wUnusedD71B:: ; d71b
+wUnusedD71B:: ; d71a
ds 1
-wTileInFrontOfBoulderAndBoulderCollisionResult:: ; d71c
+wTileInFrontOfBoulderAndBoulderCollisionResult:: ; d71b
; used to store the tile in front of the boulder when trying to push a boulder
; also used to store the result of the collision check ($ff for a collision and $00 for no collision)
ds 1
-wDungeonWarpDestinationMap:: ; d71d
+wDungeonWarpDestinationMap:: ; d71c
; destination map for dungeon warps
ds 1
-wWhichDungeonWarp:: ; d71e
+wWhichDungeonWarp:: ; d71d
; which dungeon warp within the source map was used
ds 1
-wUnusedD71F:: ; d71f
+wUnusedD71F:: ; d71e
ds 1
ds 8
-wd728:: ; d728
+wd728:: ; d727
; bit 0: using Strength outside of battle
; bit 1: set by IsSurfingAllowed when surfing's allowed, but the caller resets it after checking the result
; bit 3: received Old Rod
@@ -2975,19 +3360,19 @@ wd728:: ; d728
ds 1
-wBeatGymFlags:: ; d72a
+wBeatGymFlags:: ; d729
; redundant because it matches wObtainedBadges
; used to determine whether to show name on statue and in two NPC text scripts
ds 1
ds 1
-wd72c:: ; d72c
+wd72c:: ; d72b
; bit 0: if not set, the 3 minimum steps between random battles have passed
; bit 1: prevent audio fade out
ds 1
-wd72d:: ; d72d
+wd72d:: ; d72c
; This variable is used for temporary flags and as the destination map when
; warping to the Trade Center or Colosseum.
; bit 0: sprite facing directions have been initialised in the Trade Center
@@ -3000,7 +3385,7 @@ wd72d:: ; d72d
; battles anyway).
ds 1
-wd72e:: ; d72e
+wd72e:: ; d72d
; bit 0: the player has received Lapras in the Silph Co. building
; bit 1: set in various places, but doesn't appear to have an effect
; bit 2: the player has healed pokemon at a pokemon center at least once
@@ -3013,7 +3398,7 @@ wd72e:: ; d72e
ds 1
-wd730:: ; d730
+wd730:: ; d72f
; bit 0: NPC sprite being moved by script
; bit 5: ignore joypad input
; bit 6: print text with no delay between each letter
@@ -3022,7 +3407,7 @@ wd730:: ; d730
ds 1
-wd732:: ; d732
+wd732:: ; d731
; bit 0: play time being counted
; bit 1: remnant of debug mode? not set by the game code.
; if it is set
@@ -3036,7 +3421,7 @@ wd732:: ; d732
; bit 6: map destination is [wLastBlackoutMap] (usually the last used pokemon center, but could be the player's house)
ds 1
-wFlags_D733:: ; d733
+wFlags_D733:: ; d732
; bit 0: running a test battle
; bit 1: prevent music from changing when entering new map
; bit 2: skip the joypad check in CheckWarpsNoCollision (used for the forced warp down the waterfall in the Seafoam Islands)
@@ -3045,12 +3430,15 @@ wFlags_D733:: ; d733
; bit 7: used fly out of battle
ds 1
-wBeatLorelei:: ; d734
+wBeatLorelei:: ; d733
; bit 1: set when you beat Lorelei and reset in Indigo Plateau lobby
; the game uses this to tell when Elite 4 events need to be reset
- ds 2
+ ds 1
-wd736:: ; d736
+wd735:: ; d734
+ ds 1
+
+wd736:: ; d735
; bit 0: check if the player is standing on a door and make him walk down a step if so
; bit 1: the player is currently stepping down from a door
; bit 2: standing on a warp
@@ -3058,63 +3446,73 @@ wd736:: ; d736
; bit 7: player sprite spinning due to spin tiles (Rocket hideout / Viridian Gym)
ds 1
-wCompletedInGameTradeFlags:: ; d737
+wCompletedInGameTradeFlags:: ; d736
ds 2
ds 2
-wWarpedFromWhichWarp:: ; d73b
+wWarpedFromWhichWarp:: ; d73a
ds 1
-wWarpedFromWhichMap:: ; d73c
+wWarpedFromWhichMap:: ; d73b
ds 1
ds 2
-wCardKeyDoorY:: ; d73f
+wCardKeyDoorY:: ; d73e
ds 1
-wCardKeyDoorX:: ; d740
+wCardKeyDoorX:: ; d73f
ds 1
ds 2
-wFirstLockTrashCanIndex:: ; d743
+wFirstLockTrashCanIndex:: ; d742
ds 1
wSecondLockTrashCanIndex:: ; d744
ds 1
ds 2
-wEventFlags:: ; d747
- ds 320
-wLinkEnemyTrainerName:: ; d887
+wEventFlags:: ; d746
+; below here are mostly in game flags
+
+; d74b
+; bit 0: Prof. Oak has lead the player to the north end of his lab
+; bit 1: Prof. Oak has asked the player to choose a pokemon
+; bit 2: the player and the rival have received their pokemon
+; bit 3: the player has battled the rival in Oak's lab
+; bit 4: Prof. Oak has given the player 5 pokeballs
+; bit 5: received pokedex
+ flag_array NUM_EVENT_FLAGS
+
+wLinkEnemyTrainerName:: ; d886
; linked game's trainer name
-wGrassRate:: ; d887
+wGrassRate:: ; d886
ds 1
-wGrassMons:: ; d888
- ;ds 20
+wGrassMons:: ; d887
+; ds 20
ds 11
; Overload wGrassMons
-wSerialEnemyDataBlock:: ; d893
+wSerialEnemyDataBlock:: ; d892
ds 9
-wEnemyPartyCount:: ds 1 ; d89c
-wEnemyPartyMons:: ds PARTY_LENGTH + 1 ; d89d
+wEnemyPartyCount:: ds 1 ; d89b
+wEnemyPartyMons:: ds PARTY_LENGTH + 1 ; d89c
; Overload enemy party data
UNION
-wWaterRate:: db ; d8a4
-wWaterMons:: db ; d8a5
+wWaterRate:: db ; d8a3
+wWaterMons:: db ; d8a4
NEXTU
-wEnemyMons:: ; d8a4
+wEnemyMons:: ; d8a3
wEnemyMon1:: party_struct wEnemyMon1
wEnemyMon2:: party_struct wEnemyMon2
wEnemyMon3:: party_struct wEnemyMon3
@@ -3122,80 +3520,85 @@ wEnemyMon4:: party_struct wEnemyMon4
wEnemyMon5:: party_struct wEnemyMon5
wEnemyMon6:: party_struct wEnemyMon6
-wEnemyMonOT:: ds NAME_LENGTH * PARTY_LENGTH ; d9ac
-wEnemyMonNicks:: ds NAME_LENGTH * PARTY_LENGTH ; d9ee
+wEnemyMonOT:: ds NAME_LENGTH * PARTY_LENGTH ; d9ab
+wEnemyMonNicks:: ds NAME_LENGTH * PARTY_LENGTH ; d9ed
ENDU
-wTrainerHeaderPtr:: ; da30
+wTrainerHeaderPtr:: ; da2f
ds 2
ds 6
-wOpponentAfterWrongAnswer:: ; da38
+wOpponentAfterWrongAnswer:: ; da37
; the trainer the player must face after getting a wrong answer in the Cinnabar
; gym quiz
-wUnusedDA38:: ; da38
+wUnusedDA38:: ; da37
ds 1
-wCurMapScript:: ; da39
+wCurMapScript:: ; da38
; index of current map script, mostly used as index for function pointer array
; mostly copied from map-specific map script pointer and written back later
ds 1
ds 7
-wPlayTimeHours:: ; da41
+wPlayTimeHours:: ; da40
ds 1
-wPlayTimeMaxed:: ; da42
+wPlayTimeMaxed:: ; da41
ds 1
-wPlayTimeMinutes:: ; da43
+wPlayTimeMinutes:: ; da42
ds 1
-wPlayTimeSeconds:: ; da44
+wPlayTimeSeconds:: ; da43
ds 1
-wPlayTimeFrames:: ; da45
+wPlayTimeFrames:: ; da44
ds 1
-wSafariZoneGameOver:: ; da46
+wSafariZoneGameOver:: ; da45
ds 1
-wNumSafariBalls:: ; da47
+wNumSafariBalls:: ; da46
ds 1
-wDayCareInUse:: ; da48
+wDayCareInUse:: ; da47
; 0 if no pokemon is in the daycare
; 1 if pokemon is in the daycare
ds 1
-wDayCareMonName:: ds NAME_LENGTH ; da49
-wDayCareMonOT:: ds NAME_LENGTH ; da54
+wDayCareMonName:: ds NAME_LENGTH ; da48
+wDayCareMonOT:: ds NAME_LENGTH ; da53
-wDayCareMon:: box_struct wDayCareMon ; da5f
+wDayCareMon:: box_struct wDayCareMon ; da5e
wMainDataEnd::
wBoxDataStart::
-wNumInBox:: ds 1 ; da80
-wBoxSpecies:: ds MONS_PER_BOX + 1
+wNumInBox:: ds 1 ; da7f
+wBoxSpecies:: ds MONS_PER_BOX + 1 ; da80
wBoxMons::
-wBoxMon1:: box_struct wBoxMon1 ; da96
-wBoxMon2:: ds box_struct_length * (MONS_PER_BOX + -1) ; dab7
-
-wBoxMonOT:: ds NAME_LENGTH * MONS_PER_BOX ; dd2a
-wBoxMonNicks:: ds NAME_LENGTH * MONS_PER_BOX ; de06
-wBoxMonNicksEnd:: ; dee2
+wBoxMon1:: box_struct wBoxMon1 ; da95
+wBoxMon2:: ds box_struct_length * (MONS_PER_BOX + -1) ; dab6
+wBoxMonOT:: ds NAME_LENGTH * MONS_PER_BOX ; dd29
+wBoxMonNicks:: ds NAME_LENGTH * MONS_PER_BOX ; de05
+wBoxMonNicksEnd:: ; dee1
wBoxDataEnd::
-; dee2
+wGBCBasePalPointers:: ds NUM_ACTIVE_PALS * 2 ; dee1
+wGBCPal:: ds PAL_SIZE ; dee9
+wLastBGP:: ds 1 ; def1
+wLastOBP0:: ds 1 ; def2
+wLastOBP1:: ds 1 ; def3
+wdef5:: ds 1 ; def4
+wBGPPalsBuffer:: ds NUM_ACTIVE_PALS * PAL_SIZE ; def5
-SECTION "Stack", WRAM0
+SECTION "Stack", WRAMX
wStack:: ; dfff