The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking > Binary Hack Research & Development
Reload this Page Code ASM Resource Thread

Notices
For all updates, view the main page.

Binary Hack Research & Development Got a well-founded knack with your binary Pokémon hacks? Love reverse-engineering them? For the traditional Pokémon ROM hacker, this is the spot for polling and gathering your ideas, and then implementing them! Share your hypothesis, get ideas from others, and collaborate to create!

Ad Content
Reply
 
Thread Tools
  #1351   Link to this post, but load the entire thread.  
Old June 1st, 2018 (9:19 AM).
UltimaSoul UltimaSoul is offline
 
Join Date: May 2018
Posts: 53
Quote:
Originally Posted by Xencleamas View Post
I have modified and enhanced azurile13's (credits and kudos to him) routine to make this supported on the Compiler's THUMB.bat. These are the things I modified:
  • Added routines creating the hooks that are to be copy-pasted on their respective locations. There are 11 hooks.
  • Added the master location of the routine in which the hooks will create locations for those routines. Insert your free space on .equ MyLoc. Format: 0x###### (Hexadecimal Number)
  • Created and added a new index list of Pokémon up to Generation VI including the formes in style of KDS/Chacha Dinosaur from the filenames of MrDollSteak's sprites in his Sugimori and Gen VI threads. I think there is no master index list for Generation VII. If there is, please PM me and I will add those.
  • With the list created as stated above, you will just have to create your own Regional Pokédex by copy-pasting from your Excel and Notepad file to below "regional_dex_order" and .hword 0x0000 should be first in the list. Make sure the names are all CAPS-LOCKED. In case of Nidorans, Farfetch'd, Mr. Mime, Ho-Oh, Mime Jr., Porygon-Z, and Flabébé, their characters are changed so you'll have to look for them in the master list. NOTE: Cohagrigus have been filtered out and changed into asterisks (*). Remember to correct its name before generating the binary file otherwise the .asm file won't work.

Custom Regional Pokédex for FireRed:
Spoiler:
Code:
.thumb
.align

.equ number_of_mons_in_regional_dex, 202 @or however long you wanted your regional dex to be
.equ number_of_mons_in_national_dex, 386
.equ MyLoc, 0x888888 @insert your location here
.equ RomAreaOffset,	0x8000000

@Kanto

.equ UNKNOWN, 0x0
.equ BULBASAUR, 0x1
.equ IVYSAUR, 0x2
.equ VENUSAUR, 0x3
.equ CHARMANDER, 0x4
.equ CHARMELEON, 0x5
.equ CHARIZARD, 0x6
.equ SQUIRTLE, 0x7
.equ WARTORTLE, 0x8
.equ BLASTOISE, 0x9
.equ CATERPIE, 0xA
.equ METAPOD, 0xB
.equ BUTTERFREE, 0xC
.equ WEEDLE, 0xD
.equ KAKUNA, 0xE
.equ BEEDRILL, 0xF
.equ PIDGEY, 0x10
.equ PIDGEOTTO, 0x11
.equ PIDGEOT, 0x12
.equ RATTATA, 0x13
.equ RATICATE, 0x14
.equ SPEAROW, 0x15
.equ FEAROW, 0x16
.equ EKANS, 0x17
.equ ARBOK, 0x18
.equ PIKACHU, 0x19
.equ RAICHU, 0x1A
.equ SANDSHREW, 0x1B
.equ SANDSLASH, 0x1C
.equ NIDORAN_F, 0x1D
.equ NIDORINA, 0x1E
.equ NIDOQUEEN, 0x1F
.equ NIDORAN_M, 0x20
.equ NIDORINO, 0x21
.equ NIDOKING, 0x22
.equ CLEFAIRY, 0x23
.equ CLEFABLE, 0x24
.equ VULPIX, 0x25
.equ NINETALES, 0x26
.equ JIGGLYPUFF, 0x27
.equ WIGGLYTUFF, 0x28
.equ ZUBAT, 0x29
.equ GOLBAT, 0x2A
.equ ODDISH, 0x2B
.equ GLOOM, 0x2C
.equ VILEPLUME, 0x2D
.equ PARAS, 0x2E
.equ PARASECT, 0x2F
.equ VENONAT, 0x30
.equ VENOMOTH, 0x31
.equ DIGLETT, 0x32
.equ DUGTRIO, 0x33
.equ MEOWTH, 0x34
.equ PERSIAN, 0x35
.equ PSYDUCK, 0x36
.equ GOLDUCK, 0x37
.equ MANKEY, 0x38
.equ PRIMEAPE, 0x39
.equ GROWLITHE, 0x3A
.equ ARCANINE, 0x3B
.equ POLIWAG, 0x3C
.equ POLIWHIRL, 0x3D
.equ POLIWRATH, 0x3E
.equ ABRA, 0x3F
.equ KADABRA, 0x40
.equ ALAKAZAM, 0x41
.equ MACHOP, 0x42
.equ MACHOKE, 0x43
.equ MACHAMP, 0x44
.equ BELLSPROUT, 0x45
.equ WEEPINBELL, 0x46
.equ VICTREEBEL, 0x47
.equ TENTACOOL, 0x48
.equ TENTACRUEL, 0x49
.equ GEODUDE, 0x4A
.equ GRAVELER, 0x4B
.equ GOLEM, 0x4C
.equ PONYTA, 0x4D
.equ RAPIDASH, 0x4E
.equ SLOWPOKE, 0x4F
.equ SLOWBRO, 0x50
.equ MAGNEMITE, 0x51
.equ MAGNETON, 0x52
.equ FARFETCH_D, 0x53
.equ DODUO, 0x54
.equ DODRIO, 0x55
.equ SEEL, 0x56
.equ DEWGONG, 0x57
.equ GRIMER, 0x58
.equ MUK, 0x59
.equ SHELLDER, 0x5A
.equ CLOYSTER, 0x5B
.equ GASTLY, 0x5C
.equ HAUNTER, 0x5D
.equ GENGAR, 0x5E
.equ ONIX, 0x5F
.equ DROWZEE, 0x60
.equ HYPNO, 0x61
.equ KRABBY, 0x62
.equ KINGLER, 0x63
.equ VOLTORB, 0x64
.equ ELECTRODE, 0x65
.equ EXEGGCUTE, 0x66
.equ EXEGGUTOR, 0x67
.equ CUBONE, 0x68
.equ MAROWAK, 0x69
.equ HITMONLEE, 0x6A
.equ HITMONCHAN, 0x6B
.equ LICKITUNG, 0x6C
.equ KOFFING, 0x6D
.equ WEEZING, 0x6E
.equ RHYHORN, 0x6F
.equ RHYDON, 0x70
.equ CHANSEY, 0x71
.equ TANGELA, 0x72
.equ KANGASKHAN, 0x73
.equ HORSEA, 0x74
.equ SEADRA, 0x75
.equ GOLDEEN, 0x76
.equ SEAKING, 0x77
.equ STARYU, 0x78
.equ STARMIE, 0x79
.equ MR_MIME, 0x7A
.equ SCYTHER, 0x7B
.equ JYNX, 0x7C
.equ ELECTABUZZ, 0x7D
.equ MAGMAR, 0x7E
.equ PINSIR, 0x7F
.equ TAUROS, 0x80
.equ MAGIKARP, 0x81
.equ GYARADOS, 0x82
.equ LAPRAS, 0x83
.equ DITTO, 0x84
.equ EEVEE, 0x85
.equ VAPOREON, 0x86
.equ JOLTEON, 0x87
.equ FLAREON, 0x88
.equ PORYGON, 0x89
.equ OMANYTE, 0x8A
.equ OMASTAR, 0x8B
.equ KABUTO, 0x8C
.equ KABUTOPS, 0x8D
.equ AERODACTYL, 0x8E
.equ SNORLAX, 0x8F
.equ ARTICUNO, 0x90
.equ ZAPDOS, 0x91
.equ MOLTRES, 0x92
.equ DRATINI, 0x93
.equ DRAGONAIR, 0x94
.equ DRAGONITE, 0x95
.equ MEWTWO, 0x96
.equ MEW, 0x97
.equ CHIKORITA, 0x98
.equ BAYLEEF, 0x99
.equ MEGANIUM, 0x9A
.equ CYNDAQUIL, 0x9B
.equ QUILAVA, 0x9C
.equ TYPHLOSION, 0x9D
.equ TOTODILE, 0x9E
.equ CROCONAW, 0x9F
.equ FERALIGATR, 0xA0
.equ SENTRET, 0xA1
.equ FURRET, 0xA2
.equ HOOTHOOT, 0xA3
.equ NOCTOWL, 0xA4
.equ LEDYBA, 0xA5
.equ LEDIAN, 0xA6
.equ SPINARAK, 0xA7
.equ ARIADOS, 0xA8
.equ CROBAT, 0xA9
.equ CHINCHOU, 0xAA
.equ LANTURN, 0xAB
.equ PICHU, 0xAC
.equ CLEFFA, 0xAD
.equ IGGLYBUFF, 0xAE
.equ TOGEPI, 0xAF
.equ TOGETIC, 0xB0
.equ NATU, 0xB1
.equ XATU, 0xB2
.equ MAREEP, 0xB3
.equ FLAAFFY, 0xB4
.equ AMPHAROS, 0xB5
.equ BELLOSSOM, 0xB6
.equ MARILL, 0xB7
.equ AZUMARILL, 0xB8
.equ SUDOWOODO, 0xB9
.equ POLITOED, 0xBA
.equ HOPPIP, 0xBB
.equ SKIPLOOM, 0xBC
.equ JUMPLUFF, 0xBD
.equ AIPOM, 0xBE
.equ SUNKERN, 0xBF
.equ SUNFLORA, 0xC0
.equ YANMA, 0xC1
.equ WOOPER, 0xC2
.equ QUAGSIRE, 0xC3
.equ ESPEON, 0xC4
.equ UMBREON, 0xC5
.equ MURKROW, 0xC6
.equ SLOWKING, 0xC7
.equ MISDREAVUS, 0xC8
.equ UNOWN, 0xC9
.equ WOBBUFFET, 0xCA
.equ GIRAFARIG, 0xCB
.equ PINECO, 0xCC
.equ FORRETRESS, 0xCD
.equ DUNSPARCE, 0xCE
.equ GLIGAR, 0xCF
.equ STEELIX, 0xD0
.equ SNUBBULL, 0xD1
.equ GRANBULL, 0xD2
.equ QWILFISH, 0xD3
.equ SCIZOR, 0xD4
.equ SHUCKLE, 0xD5
.equ HERACROSS, 0xD6
.equ SNEASEL, 0xD7
.equ TEDDIURSA, 0xD8
.equ URSARING, 0xD9
.equ SLUGMA, 0xDA
.equ MAGCARGO, 0xDB
.equ SWINUB, 0xDC
.equ PILOSWINE, 0xDD
.equ CORSOLA, 0xDE
.equ REMORAID, 0xDF
.equ OCTILLERY, 0xE0
.equ DELIBIRD, 0xE1
.equ MANTINE, 0xE2
.equ SKARMORY, 0xE3
.equ HOUNDOUR, 0xE4
.equ HOUNDOOM, 0xE5
.equ KINGDRA, 0xE6
.equ PHANPY, 0xE7
.equ DONPHAN, 0xE8
.equ PORYGON2, 0xE9
.equ STANTLER, 0xEA
.equ SMEARGLE, 0xEB
.equ TYROGUE, 0xEC
.equ HITMONTOP, 0xED
.equ SMOOCHUM, 0xEE
.equ ELEKID, 0xEF
.equ MAGBY, 0xF0
.equ MILTANK, 0xF1
.equ BLISSEY, 0xF2
.equ RAIKOU, 0xF3
.equ ENTEI, 0xF4
.equ SUICUNE, 0xF5
.equ LARVITAR, 0xF6
.equ PUPITAR, 0xF7
.equ TYRANITAR, 0xF8
.equ LUGIA, 0xF9
.equ HO_OH, 0xFA
.equ CELEBI, 0xFB
.equ NOPE, 0xFC
.equ NOPE, 0xFD
.equ NOPE, 0xFE
.equ NOPE, 0xFF
.equ NOPE, 0x100
.equ NOPE, 0x101
.equ NOPE, 0x102
.equ NOPE, 0x103
.equ NOPE, 0x104
.equ NOPE, 0x105
.equ NOPE, 0x106
.equ NOPE, 0x107
.equ NOPE, 0x108
.equ NOPE, 0x109
.equ NOPE, 0x10A
.equ NOPE, 0x10B
.equ NOPE, 0x10C
.equ NOPE, 0x10D
.equ NOPE, 0x10E
.equ NOPE, 0x10F
.equ NOPE, 0x110
.equ NOPE, 0x111
.equ NOPE, 0x112
.equ NOPE, 0x113
.equ NOPE, 0x114
.equ TREECKO, 0x115
.equ GROVYLE, 0x116
.equ SCEPTILE, 0x117
.equ TORCHIC, 0x118
.equ COMBUSKEN, 0x119
.equ BLAZIKEN, 0x11A
.equ MUDKIP, 0x11B
.equ MARSHTOMP, 0x11C
.equ SWAMPERT, 0x11D
.equ POOCHYENA, 0x11E
.equ MIGHTYENA, 0x11F
.equ ZIGZAGOON, 0x120
.equ LINOONE, 0x121
.equ WURMPLE, 0x122
.equ SILCOON, 0x123
.equ BEAUTIFLY, 0x124
.equ CASCOON, 0x125
.equ DUSTOX, 0x126
.equ LOTAD, 0x127
.equ LOMBRE, 0x128
.equ LUDICOLO, 0x129
.equ SEEDOT, 0x12A
.equ NUZLEAF, 0x12B
.equ SHIFTRY, 0x12C
.equ NINCADA, 0x12D
.equ NINJASK, 0x12E
.equ SHEDINJA, 0x12F
.equ TAILLOW, 0x130
.equ SWELLOW, 0x131
.equ SHROOMISH, 0x132
.equ BRELOOM, 0x133
.equ SPINDA, 0x134
.equ WINGULL, 0x135
.equ PELIPPER, 0x136
.equ SURSKIT, 0x137
.equ MASQUERAIN, 0x138
.equ WAILMER, 0x139
.equ WAILORD, 0x13A
.equ SKITTY, 0x13B
.equ DELCATTY, 0x13C
.equ KECLEON, 0x13D
.equ BALTOY, 0x13E
.equ CLAYDOL, 0x13F
.equ NOSEPASS, 0x140
.equ TORKOAL, 0x141
.equ SABLEYE, 0x142
.equ BARBOACH, 0x143
.equ WHISCASH, 0x144
.equ LUVDISC, 0x145
.equ CORPHISH, 0x146
.equ CRAWDAUNT, 0x147
.equ FEEBAS, 0x148
.equ MILOTIC, 0x149
.equ CARVANHA, 0x14A
.equ SHARPEDO, 0x14B
.equ TRAPINCH, 0x14C
.equ VIBRAVA, 0x14D
.equ FLYGON, 0x14E
.equ MAKUHITA, 0x14F
.equ HARIYAMA, 0x150
.equ ELECTRIKE, 0x151
.equ MANECTRIC, 0x152
.equ NUMEL, 0x153
.equ CAMERUPT, 0x154
.equ SPHEAL, 0x155
.equ SEALEO, 0x156
.equ WALREIN, 0x157
.equ CACNEA, 0x158
.equ CACTURNE, 0x159
.equ SNORUNT, 0x15A
.equ GLALIE, 0x15B
.equ LUNATONE, 0x15C
.equ SOLROCK, 0x15D
.equ AZURILL, 0x15E
.equ SPOINK, 0x15F
.equ GRUMPIG, 0x160
.equ PLUSLE, 0x161
.equ MINUN, 0x162
.equ MAWILE, 0x163
.equ MEDITITE, 0x164
.equ MEDICHAM, 0x165
.equ SWABLU, 0x166
.equ ALTARIA, 0x167
.equ WYNAUT, 0x168
.equ DUSKULL, 0x169
.equ DUSCLOPS, 0x16A
.equ ROSELIA, 0x16B
.equ SLAKOTH, 0x16C
.equ VIGOROTH, 0x16D
.equ SLAKING, 0x16E
.equ GULPIN, 0x16F
.equ SWALOT, 0x170
.equ TROPIUS, 0x171
.equ WHISMUR, 0x172
.equ LOUDRED, 0x173
.equ EXPLOUD, 0x174
.equ CLAMPERL, 0x175
.equ HUNTAIL, 0x176
.equ GOREBYSS, 0x177
.equ ABSOL, 0x178
.equ SHUPPET, 0x179
.equ BANETTE, 0x17A
.equ SEVIPER, 0x17B
.equ ZANGOOSE, 0x17C
.equ RELICANTH, 0x17D
.equ ARON, 0x17E
.equ LAIRON, 0x17F
.equ AGGRON, 0x180
.equ CASTFORM, 0x181
.equ VOLBEAT, 0x182
.equ ILLUMISE, 0x183
.equ LILEEP, 0x184
.equ CRADILY, 0x185
.equ ANORITH, 0x186
.equ ARMALDO, 0x187
.equ RALTS, 0x188
.equ KIRLIA, 0x189
.equ GARDEVOIR, 0x18A
.equ BAGON, 0x18B
.equ SHELGON, 0x18C
.equ SALAMENCE, 0x18D
.equ BELDUM, 0x18E
.equ METANG, 0x18F
.equ METAGROSS, 0x190
.equ REGIROCK, 0x191
.equ REGICE, 0x192
.equ REGISTEEL, 0x193
.equ KYOGRE, 0x194
.equ GROUDON, 0x195
.equ RAYQUAZA, 0x196
.equ LATIAS, 0x197
.equ LATIOS, 0x198
.equ JIRACHI, 0x199
.equ DEOXYS, 0x19A
.equ CHIMECHO, 0x19B
.equ EGG, 0x19C
.equ UNOWN_B, 0x19D
.equ UNOWN_C, 0x19E
.equ UNOWN_D, 0x19F
.equ UNOWN_E, 0x1A0
.equ UNOWN_F, 0x1A1
.equ UNOWN_G, 0x1A2
.equ UNOWN_H, 0x1A3
.equ UNOWN_I, 0x1A4
.equ UNOWN_J, 0x1A5
.equ UNOWN_K, 0x1A6
.equ UNOWN_L, 0x1A7
.equ UNOWN_M, 0x1A8
.equ UNOWN_N, 0x1A9
.equ UNOWN_O, 0x1AA
.equ UNOWN_P, 0x1AB
.equ UNOWN_Q, 0x1AC
.equ UNOWN_R, 0x1AD
.equ UNOWN_S, 0x1AE
.equ UNOWN_T, 0x1AF
.equ UNOWN_U, 0x1B0
.equ UNOWN_V, 0x1B1
.equ UNOWN_W, 0x1B2
.equ UNOWN_X, 0x1B3
.equ UNOWN_Y, 0x1B4
.equ UNOWN_Z, 0x1B5
.equ UNOWN_EXCLAMATION, 0x1B6
.equ UNOWN_QUESTION, 0x1B7
.equ TURTWIG, 0x1B8
.equ GROTLE, 0x1B9
.equ TORTERRA, 0x1BA
.equ CHIMCHAR, 0x1BB
.equ MONFERNO, 0x1BC
.equ INFERNAPE, 0x1BD
.equ PIPLUP, 0x1BE
.equ PRINPLUP, 0x1BF
.equ EMPOLEON, 0x1C0
.equ STARLY, 0x1C1
.equ STARAVIA, 0x1C2
.equ STARAPTOR, 0x1C3
.equ BIDOOF, 0x1C4
.equ BIBAREL, 0x1C5
.equ KRICKETOT, 0x1C6
.equ KRICKETUNE, 0x1C7
.equ SHINX, 0x1C8
.equ LUXIO, 0x1C9
.equ LUXRAY, 0x1CA
.equ BUDEW, 0x1CB
.equ ROSERADE, 0x1CC
.equ CRANIDOS, 0x1CD
.equ RAMPARDOS, 0x1CE
.equ SHIELDON, 0x1CF
.equ BASTIODON, 0x1D0
.equ BURMY, 0x1D1
.equ WORMADAM, 0x1D2
.equ MOTHIM, 0x1D3
.equ COMBEE, 0x1D4
.equ VESPIQUEN, 0x1D5
.equ PACHIRISU, 0x1D6
.equ BUIZEL, 0x1D7
.equ FLOATZEL, 0x1D8
.equ CHERUBI, 0x1D9
.equ CHERRIM, 0x1DA
.equ SHELLOS, 0x1DB
.equ GASTRODON, 0x1DC
.equ AMBIPOM, 0x1DD
.equ DRIFLOON, 0x1DE
.equ DRIFBLIM, 0x1DF
.equ BUNEARY, 0x1E0
.equ LOPUNNY, 0x1E1
.equ MISMAGIUS, 0x1E2
.equ HONCHKROW, 0x1E3
.equ GLAMEOW, 0x1E4
.equ PURUGLY, 0x1E5
.equ CHINGLING, 0x1E6
.equ STUNKY, 0x1E7
.equ SKUNTANK, 0x1E8
.equ BRONZOR, 0x1E9
.equ BRONZONG, 0x1EA
.equ BONSLY, 0x1EB
.equ MIME_JR, 0x1EC
.equ HAPPINY, 0x1ED
.equ CHATOT, 0x1EE
.equ SPIRITOMB, 0x1EF
.equ GIBLE, 0x1F0
.equ GABITE, 0x1F1
.equ GARCHOMP, 0x1F2
.equ MUNCHLAX, 0x1F3
.equ RIOLU, 0x1F4
.equ LUCARIO, 0x1F5
.equ HIPPOPOTAS, 0x1F6
.equ HIPPOWDON, 0x1F7
.equ SKORUPI, 0x1F8
.equ DRAPION, 0x1F9
.equ CROAGUNK, 0x1FA
.equ TOXICROAK, 0x1FB
.equ CARNIVINE, 0x1FC
.equ FINNEON, 0x1FD
.equ LUMINEON, 0x1FE
.equ MANTYKE, 0x1FF
.equ SNOVER, 0x200
.equ ABOMASNOW, 0x201
.equ WEAVILE, 0x202
.equ MAGNEZONE, 0x203
.equ LICKILICKY, 0x204
.equ RHYPERIOR, 0x205
.equ TANGROWTH, 0x206
.equ ELECTIVIRE, 0x207
.equ MAGMORTAR, 0x208
.equ TOGEKISS, 0x209
.equ YANMEGA, 0x20A
.equ LEAFEON, 0x20B
.equ GLACEON, 0x20C
.equ GLISCOR, 0x20D
.equ MAMOSWINE, 0x20E
.equ PORYGON_Z, 0x20F
.equ GALLADE, 0x210
.equ PROBOPASS, 0x211
.equ DUSKNOIR, 0x212
.equ FROSLASS, 0x213
.equ ROTOM, 0x214
.equ UXIE, 0x215
.equ MESPRIT, 0x216
.equ AZELF, 0x217
.equ DIALGA, 0x218
.equ PALKIA, 0x219
.equ HEATRAN, 0x21A
.equ REGIGIGAS, 0x21B
.equ GIRATINA, 0x21C
.equ CRESSELIA, 0x21D
.equ PHIONE, 0x21E
.equ MANAPHY, 0x21F
.equ DARKRAI, 0x220
.equ SHAYMIN, 0x221
.equ ARCEUS, 0x222
.equ BURMY_SAND, 0x223
.equ BURMY_TRASH, 0x224
.equ WORMADAM_SAND, 0x225
.equ WORMADAM_THRASH, 0x226
.equ SHELLOS_EAST, 0x227
.equ GASTRODON_EAST, 0x228
.equ ROTOM_HEAT, 0x229
.equ ROTOM_WASH, 0x22A
.equ ROTOM_FROST, 0x22B
.equ ROTOM_FAN, 0x22C
.equ ROTOM_MOW, 0x22D
.equ GIRATINA_ORIGIN, 0x22E
.equ SHAYMIN_SKY, 0x22F
.equ ARCEUS_FIGHT, 0x230
.equ ARCEUS_FLYING, 0x231
.equ ARCEUS_POISON, 0x232
.equ ARCEUS_GROUND, 0x233
.equ ARCEUS_ROCK, 0x234
.equ ARCEUS_BUG, 0x235
.equ ARCEUS_GHOST, 0x236
.equ ARCEUS_STEEL, 0x237
.equ ARCEUS_UNKNOWN, 0x238
.equ ARCEUS_FIRE, 0x239
.equ ARCEUS_WATER, 0x23A
.equ ARCEUS_GRASS, 0x23B
.equ ARCEUS_ELECTRIC, 0x23C
.equ ARCEUS_PSYCHIC, 0x23D
.equ ARCEUS_ICE, 0x23E
.equ ARCEUS_DRAGON, 0x23F
.equ ARCEUS_DARK, 0x240
.equ ARCEUS_FAIRY, 0x241
.equ VICTINI, 0x242
.equ SNIVY, 0x243
.equ SERVINE, 0x244
.equ SERPERIOR, 0x245
.equ TEPIG, 0x246
.equ PIGNITE, 0x247
.equ EMBOAR, 0x248
.equ OSHAWOTT, 0x249
.equ DEWOTT, 0x24A
.equ SAMUROTT, 0x24B
.equ PATRAT, 0x24C
.equ WATCHOG, 0x24D
.equ LILLIPUP, 0x24E
.equ HERDIER, 0x24F
.equ STOUTLAND, 0x250
.equ PURRLOIN, 0x251
.equ LIEPARD, 0x252
.equ PANSAGE, 0x253
.equ SIMISAGE, 0x254
.equ PANSEAR, 0x255
.equ SIMISEAR, 0x256
.equ PANPOUR, 0x257
.equ SIMIPOUR, 0x258
.equ MUNNA, 0x259
.equ MUSHARNA, 0x25A
.equ PIDOVE, 0x25B
.equ TRANQUILL, 0x25C
.equ UNFEZANT, 0x25D
.equ BLITZLE, 0x25E
.equ ZEBSTRIKA, 0x25F
.equ ROGGENROLA, 0x260
.equ BOLDORE, 0x261
.equ GIGALITH, 0x262
.equ WOOBAT, 0x263
.equ SWOOBAT, 0x264
.equ DRILBUR, 0x265
.equ EXCADRILL, 0x266
.equ AUDINO, 0x267
.equ TIMBURR, 0x268
.equ GURDURR, 0x269
.equ CONKELDURR, 0x26A
.equ TYMPOLE, 0x26B
.equ PALPITOAD, 0x26C
.equ SEISMITOAD, 0x26D
.equ THROH, 0x26E
.equ SAWK, 0x26F
.equ SEWADDLE, 0x270
.equ SWADLOON, 0x271
.equ LEAVANNY, 0x272
.equ VENIPEDE, 0x273
.equ WHIRLIPEDE, 0x274
.equ SCOLIPEDE, 0x275
.equ COTTONEE, 0x276
.equ WHIMSICOTT, 0x277
.equ PETILIL, 0x278
.equ LILLIGANT, 0x279
.equ BASCULIN, 0x27A
.equ SANDILE, 0x27B
.equ KROKOROK, 0x27C
.equ KROOKODILE, 0x27D
.equ DARUMAKA, 0x27E
.equ DARMANITAN, 0x27F
.equ MARACTUS, 0x280
.equ DWEBBLE, 0x281
.equ CRUSTLE, 0x282
.equ SCRAGGY, 0x283
.equ SCRAFTY, 0x284
.equ SIGILYPH, 0x285
.equ YAMASK, 0x286
.equ COHAGRIGUS, 0x287
.equ TIRTOUGA, 0x288
.equ CARRACOSTA, 0x289
.equ ARCHEN, 0x28A
.equ ARCHEOPS, 0x28B
.equ TRUBBISH, 0x28C
.equ GARBODOR, 0x28D
.equ ZORUA, 0x28E
.equ ZOROARK, 0x28F
.equ MINCCINO, 0x290
.equ CINCCINO, 0x291
.equ GOTHITA, 0x292
.equ GOTHORITA, 0x293
.equ GOTHITELLE, 0x294
.equ SOLOSIS, 0x295
.equ DUOSION, 0x296
.equ REUNICLUS, 0x297
.equ DUCKLETT, 0x298
.equ SWANNA, 0x299
.equ VANILLITE, 0x29A
.equ VANILLISH, 0x29B
.equ VANILLUXE, 0x29C
.equ DEERLING, 0x29D
.equ SAWSBUCK, 0x29E
.equ EMOLGA, 0x29F
.equ KARRABLAST, 0x2A0
.equ ESCAVALIER, 0x2A1
.equ FOONGUS, 0x2A2
.equ AMOONGUSS, 0x2A3
.equ FRILLISH, 0x2A4
.equ JELLICENT, 0x2A5
.equ ALOMOMOLA, 0x2A6
.equ JOLTIK, 0x2A7
.equ GALVANTULA, 0x2A8
.equ FERROSEED, 0x2A9
.equ FERROTHORN, 0x2AA
.equ KLINK, 0x2AB
.equ KLANG, 0x2AC
.equ KLINKLANG, 0x2AD
.equ TYNAMO, 0x2AE
.equ EELEKTRIK, 0x2AF
.equ EELEKTROSS, 0x2B0
.equ ELGYEM, 0x2B1
.equ BEHEEYEM, 0x2B2
.equ LITWICK, 0x2B3
.equ LAMPENT, 0x2B4
.equ CHANDELURE, 0x2B5
.equ AXEW, 0x2B6
.equ FRAXURE, 0x2B7
.equ HAXORUS, 0x2B8
.equ CUBCHOO, 0x2B9
.equ BEARTIC, 0x2BA
.equ CRYOGONAL, 0x2BB
.equ SHELMET, 0x2BC
.equ ACCELGOR, 0x2BD
.equ STUNFISK, 0x2BE
.equ MIENFOO, 0x2BF
.equ MIENSHAO, 0x2C0
.equ DRUDDIGON, 0x2C1
.equ GOLETT, 0x2C2
.equ GOLURK, 0x2C3
.equ PAWNIARD, 0x2C4
.equ BISHARP, 0x2C5
.equ BOUFFALANT, 0x2C6
.equ RUFFLET, 0x2C7
.equ BRAVIARY, 0x2C8
.equ VULLABY, 0x2C9
.equ MANDIBUZZ, 0x2CA
.equ HEATMOR, 0x2CB
.equ DURANT, 0x2CC
.equ DEINO, 0x2CD
.equ ZWEILOUS, 0x2CE
.equ HYDREIGON, 0x2CF
.equ LARVESTA, 0x2D0
.equ VOLCARONA, 0x2D1
.equ COBALION, 0x2D2
.equ TERRAKION, 0x2D3
.equ VIRIZION, 0x2D4
.equ TORNADUS, 0x2D5
.equ THUNDURUS, 0x2D6
.equ RESHIRAM, 0x2D7
.equ ZEKROM, 0x2D8
.equ LANDORUS, 0x2D9
.equ KYUREM, 0x2DA
.equ KELDEO, 0x2DB
.equ MELOETTA, 0x2DC
.equ GENESECT, 0x2DD
.equ BASCULIN_BLUE, 0x2DE
.equ DARMANITAN_ZEN, 0x2DF
.equ DEERLING_SUMMER, 0x2E0
.equ DEERLING_AUTUMN, 0x2E1
.equ DEERLING_WINTER, 0x2E2
.equ SAWSBUCK_SUMMER, 0x2E3
.equ SAWSBUCK_AUTUMN, 0x2E4
.equ SAWSBUCK_WINTER, 0x2E5
.equ KYUREM_WHITE, 0x2E6
.equ KYUREM_BLACK, 0x2E7
.equ MELOETTA_PIROUETTE, 0x2E8
.equ GENESECT_SHOCK, 0x2E9
.equ GENESECT_BURN, 0x2EA
.equ GENESECT_CHILL, 0x2EB
.equ GENESECT_DOUSE, 0x2EC
.equ TORNADUS_THERIAN, 0x2ED
.equ THUNDURUS_THERIAN, 0x2EE
.equ LANDORUS_THERIAN, 0x2EF
.equ KELDEO_RESOLUTE, 0x2F0
.equ CHESPIN, 0x2F1
.equ QUILLADIN, 0x2F2
.equ CHESNAUGHT, 0x2F3
.equ FENNEKIN, 0x2F4
.equ BRAIXEN, 0x2F5
.equ DELPHOX, 0x2F6
.equ FROAKIE, 0x2F7
.equ FROGADIER, 0x2F8
.equ GRENINJA, 0x2F9
.equ BUNNELBY, 0x2FA
.equ DIGGERSBY, 0x2FB
.equ FLETCHLING, 0x2FC
.equ FLETCHINDER, 0x2FD
.equ TALONFLAME, 0x2FE
.equ SCATTERBUG, 0x2FF
.equ SPEWPA, 0x300
.equ VIVILLON, 0x301
.equ LITLEO, 0x302
.equ PYROAR, 0x303
.equ FLABEBE, 0x304
.equ FLOETTE, 0x305
.equ FLORGES, 0x306
.equ SKIDDO, 0x307
.equ GOGOAT, 0x308
.equ PANCHAM, 0x309
.equ PANGORO, 0x30A
.equ FURFROU, 0x30B
.equ ESPURR, 0x30C
.equ MEOWSTIC, 0x30D
.equ HONEDGE, 0x30E
.equ DOUBLADE, 0x30F
.equ AEGISLASH, 0x310
.equ SPRITZEE, 0x311
.equ AROMATISSE, 0x312
.equ SWIRLIX, 0x313
.equ SLURPUFF, 0x314
.equ INKAY, 0x315
.equ MALAMAR, 0x316
.equ BINACLE, 0x317
.equ BARBARACLE, 0x318
.equ SKRELP, 0x319
.equ DRAGALGE, 0x31A
.equ CLAUNCHER, 0x31B
.equ CLAWITZER, 0x31C
.equ HELIOPTILE, 0x31D
.equ HELIOLISK, 0x31E
.equ TYRUNT, 0x31F
.equ TYRANTRUM, 0x320
.equ AMAURA, 0x321
.equ AURORUS, 0x322
.equ SYLVEON, 0x323
.equ HAWLUCHA, 0x324
.equ DEDENNE, 0x325
.equ CARBINK, 0x326
.equ GOOMY, 0x327
.equ SLIGGOO, 0x328
.equ GOODRA, 0x329
.equ KLEFKI, 0x32A
.equ PHANTUMP, 0x32B
.equ TREVENANT, 0x32C
.equ PUMPKABOO, 0x32D
.equ GOURGEIST, 0x32E
.equ BERGMITE, 0x32F
.equ AVALUGG, 0x330
.equ NOIBAT, 0x331
.equ NOIVERN, 0x332
.equ XERNEAS, 0x333
.equ YVELTAL, 0x334
.equ ZYGARDE, 0x335
.equ DIANCIE, 0x336
.equ HOOPA, 0x337
.equ VOLCANION, 0x338
.equ PYROAR_FEMALE, 0x339
.equ FLABEBE_WHITE, 0x33A
.equ FLABEBE_YELLOW, 0x33B
.equ FLABEBE_ORANGE, 0x33C
.equ FLABEBE_BLUE, 0x33D
.equ FLOETTE_WHITE, 0x33E
.equ FLOETTE_YELLOW, 0x33F
.equ FLOETTE_ORANGE, 0x340
.equ FLOETTE_BLUE, 0x341
.equ FLORGES_WHITE, 0x342
.equ FLORGES_YELLOW, 0x343
.equ FLORGES_ORANGE, 0x344
.equ FLORGES_BLUE, 0x345
.equ MEOWSTIC_FEMALE, 0x346
.equ AEGISLASH_BLADE, 0x347
.equ PUMPKABOO_2, 0x348
.equ PUMPKABOO_3, 0x349
.equ PUMPKABOO_4, 0x34A
.equ GOURGEIST_2, 0x34B
.equ GOURGEIST_3, 0x34C
.equ GOURGEIST_4, 0x34D
.equ HOOPA_UNBOUND, 0x34E
.equ VENUSAUR_MEGA, 0x34F
.equ CHARIZARD_MEGAX, 0x350
.equ CHARIZARD_MEGAY, 0x351
.equ BLASTOISE_MEGA, 0x352
.equ BEEDRILL_MEGA, 0x353
.equ PIDGEOT_MEGA, 0x354
.equ ALAKAZAM_MEGA, 0x355
.equ SLOWBRO_MEGA, 0x356
.equ GENGAR_MEGA, 0x357
.equ KANGASKHAN_MEGA, 0x358
.equ PINSIR_MEGA, 0x359
.equ GYARADOS_MEGA, 0x35A
.equ AERODACTYL_MEGA, 0x35B
.equ MEWTWO_MEGAX, 0x35C
.equ MEWTWO_MEGAY, 0x35D
.equ AMPHAROS_MEGA, 0x35E
.equ STEELIX_MEGA, 0x35F
.equ SCIZOR_MEGA, 0x360
.equ HERACROSS_MEGA, 0x361
.equ HOUNDOOM_MEGA, 0x362
.equ TYRANITAR_MEGA, 0x363
.equ SCEPTILE_MEGA, 0x364
.equ BLAZIKEN_MEGA, 0x365
.equ SWAMPERT_MEGA, 0x366
.equ GARDEVOIR_MEGA, 0x367
.equ SABLEYE_MEGA, 0x368
.equ MAWILE_MEGA, 0x369
.equ AGGRON_MEGA, 0x36A
.equ MEDICHAM_MEGA, 0x36B
.equ MANECTRIC_MEGA, 0x36C
.equ SHARPEDO_MEGA, 0x36D
.equ CAMERUPT_MEGA, 0x36E
.equ ALTARIA_MEGA, 0x36F
.equ BANETTE_MEGA, 0x370
.equ ABSOL_MEGA, 0x371
.equ GLALIE_MEGA, 0x372
.equ SALAMENCE_MEGA, 0x373
.equ METAGROSS_MEGA, 0x374
.equ NOPE, 0x375 @Dunno why but maybe a new Latias out from the Soul Dew routine
.equ NOPE, 0x376 @Dunno why but maybe a new Latios out from the Soul Dew routine
.equ LATIAS_MEGA, 0x377
.equ LATIOS_MEGA, 0x378
.equ RAYQUAZA_MEGA, 0x379
.equ LOPUNNY_MEGA, 0x37A
.equ GARCHOMP_MEGA, 0x37B
.equ LUCARIO_MEGA, 0x37C
.equ ABOMASNOW_MEGA, 0x37D
.equ GALLADE_MEGA, 0x37E
.equ AUDINO_MEGA, 0x37F
.equ DIANCIE_MEGA, 0x380
.equ DEOXYS_NORMAL, 0x381 @Renewal of Deoxys' index
.equ DEOXYS_ATTACK, 0x382 @Renewal of Deoxys' index
.equ DEOXYS_DEFENSE, 0x383 @Renewal of Deoxys' index
.equ DEXOYS_SPEED, 0x384 @Renewal of Deoxys' index
.equ NOPE, 0x385 @Generation VII Pokemon starts here

.org 0x43F90, 0xFF
ldr r1, Hook3
bx r1
.align 2
Hook3: .word RomAreaOffset+dex_seeable_mon_hook+1

.org 0x88EDC, 0xFF
ldr r1, Hook6
bx r1
.align 2
Hook6: .word RomAreaOffset+dex_regional_count_hook+1

.org 0xCE91A, 0xFF
ldr r1, Hook4
bx r1
.align 2
Hook4: .word RomAreaOffset+dex_evolution_fix_hook+1

.org 0x10352C, 0xFF
ldr r1, Hook7
bx r1
.align 2
Hook7: .word RomAreaOffset+dex_display_hook+1

.org 0x10356C, 0xFF
ldr r0, Hook8
bx r0
.align 2
Hook8: .word RomAreaOffset+regional_dex_hook+1

.org 0x1035B4, 0xFF
ldr r1, Hook9
bx r1
.align 2
Hook9: .word RomAreaOffset+store_last_dex_seen_hook+1

.org 0x1035F4, 0xFF
ldr r0, HookA
bx r0
.align 2
HookA: .word RomAreaOffset+lazy_regional_dex_end_hook+1

.org 0x104A66, 0xFF
ldr r1, HookB
bx r1
.align 2
HookB: .word RomAreaOffset+display_regional_num_hook+1

.org 0x104BBC, 0xFF
ldr r2, Hook5
bx r2
.align 2
Hook5: .word RomAreaOffset+dex_display_counts_hook+1

.org 0x106810, 0xFF
ldr r1, Hook2
bx r1
.align 2
Hook2: .word RomAreaOffset+habitat_dex_regional_limit_hook+1

.org 0x106B84, 0xFF
ldr r1, Hook1
bx r1
.align 2
Hook1: .word RomAreaOffset+data_on_capture_hook+1

.org MyLoc, 0xFF
data_on_capture_hook:	@0x08106B84 via r1
	bl species_to_regional_dex_number
	cmp r0, #0x0
	bne capture_display_return
	ldr r0, add_task_no_capture_display
	bx r0

capture_display_return:
	ldr r0, add_task_capture_display
	bx r0


.align 2
.pool

.align 2


habitat_dex_regional_limit_hook:	@0x08106810 via r1
	push {r4, lr}
	mov r4, r0
	bl haz_national_dex_bool
	cmp r0, #0x1
	beq habitat_dex_regional_limit_return	@valid
	mov r0, r4
	bl species_to_regional_dex_number
	cmp r0, #0x0
	beq habitat_dex_regional_limit_return	@not in regional dex, return 0
	mov r0, #0x1

habitat_dex_regional_limit_return:
	pop {r4}
	pop {r1}
	bx r1


.align 2
.pool

.align 2


dex_seeable_mon_hook:	@0x08043F90 via r1
	push {r4, lr}
	mov r4, r0
	bl haz_national_dex_bool
	cmp r0, #0x0
	beq only_regional_numbered
@national
	mov r0, r4
	bl species_to_national_dex_number_1
	b dex_seeable_mon_check_valid_species

only_regional_numbered:
	mov r0, r4
	bl species_to_regional_dex_number

dex_seeable_mon_check_valid_species:
	cmp r0, #0x0
	bne dex_seeable_mon_return
	ldr r0, full_halfword

dex_seeable_mon_return:
	pop {r4}
	pop {r1}
	bx r1
.align
full_halfword:	.word 0xFFFF


.align 2
.pool

.align 2


dex_evolution_fix_hook:	@0x080CE91A via r1
	bl species_to_regional_dex_number
	cmp r0, #0x0	@not in regional dex, invalid
	beq dex_evolution_failure
	ldr r0, dex_evolution_success_return
	bx r0

dex_evolution_failure:
	mov r0, #0x11
	strh r0, [r5, #0x8]
	mov r2, #0x1
	ldr r1, dex_evolution_failure_return
	bx r1


.align 2
.pool

.align 2


dex_display_counts_hook:	@0x08104BBC via r2
	@r0: mode
	push {lr}
	cmp r1, #0x0
	beq call_regional_count
	bl national_pokedex_count
	b dex_display_counts_return

call_regional_count:
	bl dex_regional_count_hook

dex_display_counts_return:
	pop {pc}


.align 2
.pool

.align 2


dex_regional_count_hook:	@0x08088EDC via r1
	push {r4-r6, lr}
	mov r6, r0	@mode
	mov r4, #0x1	@loop
	mov r5, #0x0	@counter

dex_regional_count_loop:
	lsl r0, r4, #0x1	@loop times 2
	adr r1, regional_dex_order
	ldrh r0, [r1, r0]	@req species
	mov r1, r6	@mode
	mov r2, #0x1	@input is SPECIES
	bl dex_flag_check
	add r5, r5, r0
	add r4, #0x1
	ldr r0, regional_dex_limit
	cmp r4, r0
	blo dex_regional_count_loop
	mov r0, r5
	pop {r4-r6, pc}


.align 2
.pool

.align 2


dex_display_hook:	@0x0810352C via r1
	ldr r1, regional_dex_limit
	cmp r0, #0x0
	beq store_dex_limit_and_return
	ldr r1, national_dex_limit

store_dex_limit_and_return:
	str r1, [sp, #0x0]
	ldr r0, regional_dex_limit_return
	bx r0


.align 2
.pool

.align 2


regional_dex_hook:	@0x0810356C via r0
	mov r4, r8
	add r4, #0x1
	lsl r0, r4, #0x1	@index times 2
	adr r1, regional_dex_order
	ldrh r0, [r1, r0]
	bl species_to_national_dex_number_1
	mov r5, r0
	mov r1, #0x0
	ldr r2, regional_dex_hook_return
	bx r2


.align 2
.pool

.align 2


store_last_dex_seen_hook:	@0x081035B4 via r1
	str r0, [r2]
	mov r10, r4
	mov r4, r3
	ldr r0, def_store_string_dex_number
	bx r0


.align 2
.pool

.align 2


lazy_regional_dex_end_hook:	@0x081035F4 via r0
	mov r0, r8
	ldr r1, regional_dex_limit
	cmp r0, r1
	blo regional_dex_hook
	ldr r0, end_dex_display_return
	bx r0


.align 2
.pool

.align 2


display_regional_num_hook:	@0x08104A66 via r1
	mov r5, r0	@save species
	bl haz_national_dex_bool
	cmp r0, #0x0
	beq use_regional_dex_ordering
	ldr r1, dex_malloc_ptr
	ldr r1, [r1]
	add r1, #0x42
	ldrb r1, [r1]
	cmp r1, #0x0	@check if looking at regional dex
	beq use_regional_dex_ordering
	mov r0, r5
	bl species_to_national_dex_number_1
	b display_dex_number_return

use_regional_dex_ordering:
	mov r0, r5
	bl species_to_regional_dex_number	

display_dex_number_return:
	mov r5, r0
	ldr r0, dex_number_display_return
	bx r0





species_to_regional_dex_number:
	adr r3, regional_dex_order
	mov r2, r0	@req species
	mov r0, #0x0	@loop counter
find_regional_number_loop:
	lsl r1, r0, #0x1
	ldrh r1, [r3, r1]
	cmp r1, r2
	beq species_to_regional_dex_return
	add r0, #0x1
	ldr r1, regional_dex_limit
	cmp r0, r1
	bls find_regional_number_loop
	mov r0, #0x0	@not in dex: set number to 0
species_to_regional_dex_return:
	bx lr



species_to_national_dex_number_1:
	ldr r1, f_species_to_nat_dex
	bx r1
.align
f_species_to_nat_dex:	.word 0x08043298 + 1

haz_national_dex_bool:
	ldr r0, f_haz_national_check
	bx r0
.align
f_haz_national_check:	.word 0x0806E25C + 1

dex_flag_check:
	ldr r3, f_dex_flag_check
	bx r3
.align
f_dex_flag_check:	.word 0x08104AB0 + 1

national_pokedex_count:
	ldr r1, f_national_pokedex_count
	bx r1
.align
f_national_pokedex_count:	.word 0x08088E8C + 1



.align
add_task_no_capture_display:	.word 0x08106B90 + 1
add_task_capture_display:	.word 0x08106BA4 + 1
dex_evolution_success_return:	.word 0x080CE948 + 1
dex_evolution_failure_return:	.word 0x080CE924 + 1
regional_dex_limit:	.word number_of_mons_in_regional_dex
national_dex_limit:	.word number_of_mons_in_national_dex
regional_dex_limit_return:	.word 0x0810353a + 1
regional_dex_hook_return:	.word 0x08103578 + 1
def_store_string_dex_number:	.word 0x081035D6 + 1
end_dex_display_return:	.word 0x08103906 + 1
dex_malloc_ptr:			.word 0x0203ACF0
dex_number_display_return:	.word 0x08104A70 + 1

regional_dex_order:
.hword	0x0000
.hword	TREECKO
.hword	GROVYLE
.hword	SCEPTILE
.hword	TORCHIC
.hword	COMBUSKEN
.hword	BLAZIKEN
.hword	MUDKIP
.hword	MARSHTOMP
.hword	SWAMPERT
.hword	POOCHYENA
.hword	MIGHTYENA
.hword	ZIGZAGOON
.hword	LINOONE
.hword	WURMPLE
.hword	SILCOON
.hword	BEAUTIFLY
.hword	CASCOON
.hword	DUSTOX
.hword	LOTAD
.hword	LOMBRE
.hword	LUDICOLO
.hword	SEEDOT
.hword	NUZLEAF
.hword	SHIFTRY
.hword	TAILLOW
.hword	SWELLOW
.hword	WINGULL
.hword	PELIPPER
.hword	RALTS
.hword	KIRLIA
.hword	GARDEVOIR
.hword	SURSKIT
.hword	MASQUERAIN
.hword	SHROOMISH
.hword	BRELOOM
.hword	SLAKOTH
.hword	VIGOROTH
.hword	SLAKING
.hword	ABRA
.hword	KADABRA
.hword	ALAKAZAM
.hword	NINCADA
.hword	NINJASK
.hword	SHEDINJA
.hword	WHISMUR
.hword	LOUDRED
.hword	EXPLOUD
.hword	MAKUHITA
.hword	HARIYAMA
.hword	GOLDEEN
.hword	SEAKING
.hword	MAGIKARP
.hword	GYARADOS
.hword	AZURILL
.hword	MARILL
.hword	AZUMARILL
.hword	GEODUDE
.hword	GRAVELER
.hword	GOLEM
.hword	NOSEPASS
.hword	SKITTY
.hword	DELCATTY
.hword	ZUBAT
.hword	GOLBAT
.hword	CROBAT
.hword	TENTACOOL
.hword	TENTACRUEL
.hword	SABLEYE
.hword	MAWILE
.hword	ARON
.hword	LAIRON
.hword	AGGRON
.hword	MACHOP
.hword	MACHOKE
.hword	MACHAMP
.hword	MEDITITE
.hword	MEDICHAM
.hword	ELECTRIKE
.hword	MANECTRIC
.hword	PLUSLE
.hword	MINUN
.hword	MAGNEMITE
.hword	MAGNETON
.hword	VOLTORB
.hword	ELECTRODE
.hword	VOLBEAT
.hword	ILLUMISE
.hword	ODDISH
.hword	GLOOM
.hword	VILEPLUME
.hword	BELLOSSOM
.hword	DODUO
.hword	DODRIO
.hword	ROSELIA
.hword	GULPIN
.hword	SWALOT
.hword	CARVANHA
.hword	SHARPEDO
.hword	WAILMER
.hword	WAILORD
.hword	NUMEL
.hword	CAMERUPT
.hword	SLUGMA
.hword	MAGCARGO
.hword	TORKOAL
.hword	GRIMER
.hword	MUK
.hword	KOFFING
.hword	WEEZING
.hword	SPOINK
.hword	GRUMPIG
.hword	SANDSHREW
.hword	SANDSLASH
.hword	SPINDA
.hword	SKARMORY
.hword	TRAPINCH
.hword	VIBRAVA
.hword	FLYGON
.hword	CACNEA
.hword	CACTURNE
.hword	SWABLU
.hword	ALTARIA
.hword	ZANGOOSE
.hword	SEVIPER
.hword	LUNATONE
.hword	SOLROCK
.hword	BARBOACH
.hword	WHISCASH
.hword	CORPHISH
.hword	CRAWDAUNT
.hword	BALTOY
.hword	CLAYDOL
.hword	LILEEP
.hword	CRADILY
.hword	ANORITH
.hword	ARMALDO
.hword	IGGLYBUFF
.hword	JIGGLYPUFF
.hword	WIGGLYTUFF
.hword	FEEBAS
.hword	MILOTIC
.hword	CASTFORM
.hword	STARYU
.hword	STARMIE
.hword	KECLEON
.hword	SHUPPET
.hword	BANETTE
.hword	DUSKULL
.hword	DUSCLOPS
.hword	TROPIUS
.hword	CHIMECHO
.hword	ABSOL
.hword	VULPIX
.hword	NINETALES
.hword	PICHU
.hword	PIKACHU
.hword	RAICHU
.hword	PSYDUCK
.hword	GOLDUCK
.hword	WYNAUT
.hword	WOBBUFFET
.hword	NATU
.hword	XATU
.hword	GIRAFARIG
.hword	PHANPY
.hword	DONPHAN
.hword	PINSIR
.hword	HERACROSS
.hword	RHYHORN
.hword	RHYDON
.hword	SNORUNT
.hword	GLALIE
.hword	SPHEAL
.hword	SEALEO
.hword	WALREIN
.hword	CLAMPERL
.hword	HUNTAIL
.hword	GOREBYSS
.hword	RELICANTH
.hword	CORSOLA
.hword	CHINCHOU
.hword	LANTURN
.hword	LUVDISC
.hword	HORSEA
.hword	SEADRA
.hword	KINGDRA
.hword	BAGON
.hword	SHELGON
.hword	SALAMENCE
.hword	BELDUM
.hword	METANG
.hword	METAGROSS
.hword	REGIROCK
.hword	REGICE
.hword	REGISTEEL
.hword	LATIAS
.hword	LATIOS
.hword	KYOGRE
.hword	GROUDON
.hword	RAYQUAZA
.hword	JIRACHI
.hword	DEOXYS
This works really well, so I thank all of you that contributed to making this.

I have a question if it's possible to modify this so that in the Search Modes (Alphabetical, Type, etc.) it's able to display the Pokemon added to the regional dex. It only appears to still display only the original 151 in those Modes.
Reply With Quote
  #1352   Link to this post, but load the entire thread.  
Old June 2nd, 2018 (4:08 AM). Edited June 2nd, 2018 by Xencleamas.
Xencleamas's Avatar
Xencleamas Xencleamas is offline
Suddenly lurking in the shadows...
 
Join Date: Feb 2014
Gender: Male
Nature: Adamant
Posts: 456
Quote:
Originally Posted by UltimaSoul View Post
This works really well, so I thank all of you that contributed to making this.

I have a question if it's possible to modify this so that in the Search Modes (Alphabetical, Type, etc.) it's able to display the Pokemon added to the regional dex. It only appears to still display only the original 151 in those Modes.
You can also modify and expand those. Check this post: https://www.pokecommunity.com/showpost.php?p=9182559&postcount=827

Quote:
Originally Posted by Lance Koijer 2.0 View Post
hello... it was indeeed a nice recoding of yours...

I have questions though, does the byte on the equ. part is the actual index number of that Pokémon or that is what can be seen in National Dex. I have, however, made the arrangement that all mons first and the the forms will be the last slot.. by doing that, do I have to edit the index and replace it with the corresponding pokemon index?

Also, does it support forms now? Liké Flabebe but they will share the same index number.

EDIT: I have tried to compile all these to my THUMB Assembler but I got no luck because the code is too many that the compiler can't manage to assemble lol. Is there anyway I can compile it? I tried CMD and what I always get is error... tried piece-by-piece assembly but still the compiler can't process it.
Slr, it is now I saw this. Yes. Those are in their actual index number. If you have custom index list, then of course you have to change it on your own. I just followed the index numbers based on MrDollSteak's and thedarkdragon's sprites. Forms actually work through different indexes such as Rotom with an exception of Castform (also Cherrim and Aegislash?). They just need to have same Pokedex slot.

Can you also get which lines are getting the error? This vanilla modified coding of mine works well. PM me if you have errors rather than discussing it here.
__________________
Reply With Quote
  #1353   Link to this post, but load the entire thread.  
Old June 2nd, 2018 (8:13 AM).
UltimaSoul UltimaSoul is offline
 
Join Date: May 2018
Posts: 53
Quote:
Originally Posted by Xencleamas View Post
You can also modify and expand those. Check this post:
To clarify, it seems if the National Dex flag is set, it allows all Pokemon to display in the Search Modes which makes sense. Before it is set, only the 151 are able to be seen.

I haven't added any new Pokemon yet so I don't think I need to expand, but I have made it so that Gen 2 related Pokemon appear with their families in the regional dex.

The order isn't what I want to edit, but just the trigger for displaying Pokemon that get added to the regional dex. It seems there is only one pointer to each table as well so there's probably something that changes what gets displayed based on the National Dex flag.
Reply With Quote
  #1354   Link to this post, but load the entire thread.  
Old June 2nd, 2018 (8:14 AM).
Lance Koijer 2.0 Lance Koijer 2.0 is offline
Lance Koijer
 
Join Date: Apr 2018
Location: Criscanto Town
Gender: Male
Nature: Adamant
Posts: 104
Quote:
Originally Posted by Xencleamas View Post
You can also modify and expand those. Check this post: https://www.pokecommunity.com/showpost.php?p=9182559&postcount=827



Slr, it is now I saw this. Yes. Those are in their actual index number. If you have custom index list, then of course you have to change it on your own. I just followed the index numbers based on MrDollSteak's and thedarkdragon's sprites. Forms actually work through different indexes such as Rotom with an exception of Castform (also Cherrim and Aegislash?). They just need to have same Pokedex slot.

Can you also get which lines are getting the error? This vanilla modified coding of mine works well. PM me if you have errors rather than discussing it here.
Hello, by Pokédex slot, what do you mean? Do I have to make the index number the same in National Dex Order?
Reply With Quote
  #1355   Link to this post, but load the entire thread.  
Old June 2nd, 2018 (5:00 PM). Edited June 5th, 2018 by luuma.
luuma's Avatar
luuma luuma is offline
searching for Meaning, offering HA numel
 
Join Date: Nov 2013
Location: Stage Left
Age: 26
Gender: Male
Posts: 162
Quote:
Originally Posted by Spherical Ice View Post

Deposit entire team but one



Just going to publish this combination of two routines and a script excerpt that you can use to let the player select one Pokémon from their team, and then deposit the rest of their team.

Spoiler: Script
Code:
...
countpokemon
callasm ROUTINE_ONE+1
compare LASTRESULT 0x1
if B_<> goto @snippet1
msgbox @string1 MSG_NORMAL
call @snippet2
callasm ROUTINE_TWO+1
textcolor 0x2 // black
bufferpartypokemon 0x0 0x0
bufferboxname 0x1 0x4035
checkflag 0x834
if 0x1 goto @snippet3
msgbox @string2 MSG_NORMAL
goto @snippet4

//---------------
#org @snippet1
msgbox @string3 MSG_NORMAL
release
end

//---------------
#org @snippet2
special 0x9F
waitstate
special2 LASTRESULT 0x147
compare LASTRESULT 0x19C
if 0x1 goto @egg
compare 0x8004 0x5
if 0x2 goto @exited_out
return

//---------------
#org @snippet3
msgbox @string4 MSG_NORMAL
goto @snippet4

//---------------
#org @snippet4
...

//---------
// Strings
//---------
#org @string1
= You are only allowed to bring one\nPOKéMON.\pPlease select which one you would\nlike to bring.

#org @string2
= [buffer1] will join you.\pThe rest of your team was\ntransferred to SOMEONE's PC.\pThey were placed starting\nin BOX ["][buffer2]."

#org @string3
= You are only allowed to bring one\nPOKéMON.\pNormally, we would offer to deposit\nthe rest of your team into a BOX.\pHowever, it seems like all of your\nBOXES are full.\pPlease make room and return later.

#org @string4
= [buffer1] will join you.\pThe rest of your team was\ntransferred to BILL's PC.\pThey were placed starting\nin BOX ["][buffer2]."


Spoiler: ROUTINE_ONE
Code:
.thumb

@ This routine loops through the player's boxes to make sure there is room in a given box to deposit the entire team

main:
    push {r4-r7, lr}
    ldr r0, =(0x020370D0) @ var_800D
    ldrh r0, [r0]
    sub r0, #2 @ party size - 1
    mov r4, r0
    mov r5, #0
    
box_loop:
    mov r6, #0 @ box_id
    mov r7, #0 @ pos_in_box
    
pokemon_in_box_loop:
    mov r0, r6
    mov r1, r7
    ldr r3, =(0x0808BD30+1) @ pokemon_by_box_and_position
    bl call_via_r3
    mov r1, #0xB @ req_species
    ldr r3, =(0x0803FD44+1) @ pokemon_getattr_encrypted
    bl call_via_r3
    cmp r0, #0
    beq empty_space_found

next_loop:
    add r7, #1
    cmp r7, #30
    bls pokemon_in_box_loop

completed_current_box:
    add r6, #1
    cmp r6, #14
    bge not_enough_space
    mov r7, #0
    b pokemon_in_box_loop

empty_space_found:
    add r5, #1
    cmp r5, r4
    bls next_loop

enough_space:
    mov r0, #1
    b end
    
not_enough_space:
    mov r0, #0
    
end:
    ldr r1, =(0x020370D0) @ var_800D
    str r0, [r1]
    pop {r4-r7}
    pop {r3}

call_via_r3:
    bx r3

.pool


Spoiler: ROUTINE_TWO
Code:
.thumb

@ This routine loops through the player's party, depositing every slot (slot 0 to 5) except for the slot number in var 8004
@ It then copies the Pokémon in the remaining slot to slot 0, and then erases each Pokémon from slots 1 to 5

main:
    push {r4-r6,lr}
    ldr r4, =(0x020370C0) @ var_8004
    ldrh r4, [r4]
    ldr r5, =(0x02024284) @ party_player
    mov r6, #0

loop:
    cmp r6, #6
    beq continue
    cmp r6, r4
    beq skip
    mov r1, #0x64
    mul r1, r6
    add r0, r1, r5
    ldr r3, =(0x08040B90|1) @ pokemon_add_to_pc
    bl call_via_r3

skip:
    add r6, #1
    b loop

continue:
    mov r1, #0x64
    mul r1, r4
    add r1, r5
    mov r0, r5
    mov r2, #0x64
    ldr r3, =(0x081E5E78|1) @ memcpy
    bl call_via_r3
    ldr r0, =(0x02024284+0x64) @ second Pokémon party address
    ldr r1, =(0x081F42A0) @ just a random 500 (dec) 00 bytes in the ROM
    ldrh r2, =(0x1F4)
    ldr r3, =(0x081E5E78|1) @ memcpy
    bl call_via_r3
    pop {r4-r6}
    pop {r3}

call_via_r3:
    bx r3

.pool

Edit: I've adapted these new routines for emerald and they work a goddamn treat!

I got all the offsets I'm using from the .map file of the pokeemerald disassembly (and from just searching for copies of the offsets spherical had found in a vanilla rom)

Here's what I've changed (in bold)::
Spoiler: Script
Code:
...
countpokemon
callasm ROUTINE_ONE+1
compare LASTRESULT 0x1
if 0x5 goto @snippet1
msgbox @string1 MSG_NORMAL
call @snippet2
callasm ROUTINE_TWO+1
bufferpartypokemon 0x0 0x0
bufferboxname 0x1 0x4036
goto @snippet4

//---------------
#org @snippet2
special 0xa2
waitstate
Compare 0x8004 0xff
if 0x1 goto @fail
special2 lastresult 0x149
compare lastresult 0x19c
if 0x1 goto 0x8209b46//name rater saying "now now that is merely an egg
return

//---------------
#org @fail
msgbox @string5 MSG_NORMAL
release
end

#org @string5
= Oh well, come back soon.


Routine 1:
Spoiler:
Code:
.thumb

main:
    push {r4-r7, lr}
    ldr r0, =(0x020375f0) @ var_800D
    ldrh r0, [r0]
    sub r0, #2 @ party size - 1
    mov r4, r0
    mov r5, #0
    
box_loop:
    mov r6, #0 @ box_id
    mov r7, #0 @ pos_in_box
    
pokemon_in_box_loop:
    mov r0, r6
    mov r1, r7
    ldr r3, =(0x080d2094+1) @ pokemon_by_box_and_position (getboxedmonptr)
    bl call_via_r3
    mov r1, #0xB @ req_species
    ldr r3, =(0x0806a674+1) @ pokemon_getattr_encrypted (getboxmondata)
    bl call_via_r3
    cmp r0, #0
    beq empty_space_found

next_loop:
    add r7, #1
    cmp r7, #30
    bls pokemon_in_box_loop

completed_current_box:
    add r6, #1
    cmp r6, #14
    bge not_enough_space
    mov r7, #0
    b pokemon_in_box_loop

empty_space_found:
    add r5, #1
    cmp r5, r4
    bls next_loop

enough_space:
    mov r0, #1
    b end
    
not_enough_space:
    mov r0, #0
    
end:
    ldr r1, =(0x020375f0) @ var_800D
    str r0, [r1]
    pop {r4-r7}
    pop {r3}

call_via_r3:
    bx r3

.pool


Routine 2
Spoiler:
Code:
.thumb

main:
    push {r4-r6,lr}
    ldr r4, =(0x020375e0) @ var_8004
    ldrh r4, [r4]
    ldr r5, =(0x020244ec) @ party_player
    mov r6, #0

loop:
    cmp r6, #6
    beq continue
    cmp r6, r4
    beq skip
    mov r1, #0x64
    mul r1, r6
    add r0, r1, r5
    ldr r3, =(0x0806b490|1) @ pokemon_add_to_pc
    bl call_via_r3

skip:
    add r6, #1
    b loop

continue:
    mov r1, #0x64
    mul r1, r4
    add r1, r5
    mov r0, r5
    mov r2, #0x64
    ldr r3, =(0x082e93d4|1) @ memcpy
    bl call_via_r3
    ldr r0, =(0x020244ec+0x64) @ second Pokémon party address
    ldr r1, =(0x082e9804) @ just a random 500 (dec) 00 bytes in the ROM
    ldrh r2, =(0x1F4)
    ldr r3, =(0x082e93d4|1) @ memcpy
    bl call_via_r3
    pop {r4-r6}
    pop {r3}

call_via_r3:
    bx r3

.pool
__________________
Play Altered Emerald here!

Thanks to DizzyEgg, Lunos and the EBEU team for the battle engine, features, dynamic expansion, and the mind-bogglingly excellent disassembly project, lu-ho for a-map, Gamer2020 for pge, about 5 different hex editors, especially HexEdit which didn't suck, Microsoft Windows for Task Manager, Chaos rush for sprites and an animation disable tutorial, Spherical Ice for several excellent asm routines, Neon Skylar for Pokemon data past gen 3, YAPE while it lasted, Scizz, Knizz, darthatron's numerous tools, hackmew, Chronosplit.

Altered Emerald is very old. Its final patch marks about 9 years since I started meddling with the Emerald rom. I won't forget it, but I think it makes sense to call it a wrap. This game is in a good state, with only difficult and mundane bugs remaining. Any further changes to Pokémon are left as an exercise to the reader.
After all, you have the roms.ini files, and Gamer2020's PGE, and access to the full force of the disassembly's documentation. Go screw up my game for me? Or better yet, steal my ideas, and make them your own?

Thanks for all the years. I am still blown away by the response this got.
And cut!
Reply With Quote
  #1356   Link to this post, but load the entire thread.  
Old June 3rd, 2018 (7:31 AM).
Spherical Ice's Avatar
Spherical Ice Spherical Ice is offline
 
Join Date: Nov 2007
Location: Leicester, UK
Age: 25
Posts: 5,251
Quote:
Originally Posted by luuma View Post
I've managed to adapt routine 2 for emerald, but routine 1 is still not checking for filled boxes correctly. Keeps coming back as fine when there isn't any space left. Which isn't really a huge issue, it's a very unlikely outlier case, but it's still not great.
Does this only happen with your Emerald port, or is it an issue with my routine too? Because I've just tested it in my ROM and it works properly with all 14 boxes being full or having less than 5 empty spaces (or however many it takes to empty the party).

Quote:
Originally Posted by luuma View Post
Another thing I should mention is that you need a failsafe for special 0x9f/0xa2 in the .xse script in case the player presses B or cancels, or the routine will try to carry on while producing a bad egg. Include
Code:
Compare 0x8004 0xff
if 0x1 goto @fail
after the waitstate command
Yup, I myself noticed this when troubleshooting in my hack. Another edge case that is worth noting that you missed out is if the player selects an Egg: I'll update the FR script, and I assume an equivalent to special 0x147 exists in Emerald which you can use.
__________________
Reply With Quote
  #1357   Link to this post, but load the entire thread.  
Old June 3rd, 2018 (8:09 AM). Edited June 3rd, 2018 by luuma.
luuma's Avatar
luuma luuma is offline
searching for Meaning, offering HA numel
 
Join Date: Nov 2013
Location: Stage Left
Age: 26
Gender: Male
Posts: 162
Quote:
Originally Posted by Spherical Ice View Post
Does this only happen with your Emerald port, or is it an issue with my routine too?
Presumably just my emerald port, sorry to have bothered you. I'll give the asms in emerald a look this eve, I assumed FR 0x8BA18 was the same routine as EM 0xd1d30 because they were described in the same way in documentation, but I'm now realising I haven't even checked. Will take a look at the actual contents of the fr asm linked this eve and see if I can find anything similar in emerald

I'm guessing you've tried with e.g 2 pokemon in party needing depositing with 2 empty spaces cause besides that, I think thatcould be the only difference with how we tested. I'll try that myself too (would make little sense if that was the reason but still worth a look)

Thanks for spotting that I needed a failsafe for eggs! Emerald special is 0x149 iirc in this case, before I forget



Edit: I actually think I have a question for you!
Am i being dumb as hell or could I make routine 2 delete all pokemon but one by simply cutting out the one part that actively transfers to a pc box? my asm knowledge is appalling but I can just cut out
ldr r3, =(0x0806b490|1) @ pokemon_add_to_pc
right? the lines above are just lining up to use that routine on the correct pokemon, as far as i can tell
__________________
Play Altered Emerald here!

Thanks to DizzyEgg, Lunos and the EBEU team for the battle engine, features, dynamic expansion, and the mind-bogglingly excellent disassembly project, lu-ho for a-map, Gamer2020 for pge, about 5 different hex editors, especially HexEdit which didn't suck, Microsoft Windows for Task Manager, Chaos rush for sprites and an animation disable tutorial, Spherical Ice for several excellent asm routines, Neon Skylar for Pokemon data past gen 3, YAPE while it lasted, Scizz, Knizz, darthatron's numerous tools, hackmew, Chronosplit.

Altered Emerald is very old. Its final patch marks about 9 years since I started meddling with the Emerald rom. I won't forget it, but I think it makes sense to call it a wrap. This game is in a good state, with only difficult and mundane bugs remaining. Any further changes to Pokémon are left as an exercise to the reader.
After all, you have the roms.ini files, and Gamer2020's PGE, and access to the full force of the disassembly's documentation. Go screw up my game for me? Or better yet, steal my ideas, and make them your own?

Thanks for all the years. I am still blown away by the response this got.
And cut!
Reply With Quote
  #1358   Link to this post, but load the entire thread.  
Old June 3rd, 2018 (1:41 PM). Edited June 3rd, 2018 by Spherical Ice.
Spherical Ice's Avatar
Spherical Ice Spherical Ice is offline
 
Join Date: Nov 2007
Location: Leicester, UK
Age: 25
Posts: 5,251
Quote:
Originally Posted by luuma View Post
I actually think I have a question for you!
Am i being dumb as hell or could I make routine 2 delete all pokemon but one by simply cutting out the one part that actively transfers to a pc box? my asm knowledge is appalling but I can just cut out
ldr r3, =(0x0806b490|1) @ pokemon_add_to_pc
right? the lines above are just lining up to use that routine on the correct pokemon, as far as i can tell
Oh, my bad, I did some further testing and it does indeed not work properly. I can give rewriting it a go.

As for your question, routine 2 is supposed to:

- Take the pokemon slot number in 0x8004 that was received by the special called before this routine
- Loop through the all six slots of the player's party
-- Deposit the current slot's Pokémon to the box if it is not equal to the slot in 0x8004
- Copy the data of the Pokémon in the slot in 0x8004 and paste it in the first slot of the party
- Copy 500 00 bytes and paste them at the second slot of the party, erasing the rest of the player's party, to avoid the Pokémon from being duplicated if its slot was not the first slot
__________________
Reply With Quote
  #1359   Link to this post, but load the entire thread.  
Old June 3rd, 2018 (4:19 PM).
luuma's Avatar
luuma luuma is offline
searching for Meaning, offering HA numel
 
Join Date: Nov 2013
Location: Stage Left
Age: 26
Gender: Male
Posts: 162
Quote:
Originally Posted by Spherical Ice View Post
Oh, my bad, I did some further testing and it does indeed not work properly. I can give rewriting it a go.

As for your question, routine 2 is supposed to:
That would be awesome but it's not something I really need that much. I can just put it in as a bug report honestly. twelve years down the line we'll maybe see some poor soul on the wayback machine losing a high level pokemon to whatever trash they were ev grinding

Alright to get my deletion routine I've just changed cmp r6 #6 to cmp r6 #0. Not exactly efficient but it's a neat trick for anyone who wants all but their first mon to get deleted at some point (like I do).

Many thanks for routine 2, it is a beaut!
__________________
Play Altered Emerald here!

Thanks to DizzyEgg, Lunos and the EBEU team for the battle engine, features, dynamic expansion, and the mind-bogglingly excellent disassembly project, lu-ho for a-map, Gamer2020 for pge, about 5 different hex editors, especially HexEdit which didn't suck, Microsoft Windows for Task Manager, Chaos rush for sprites and an animation disable tutorial, Spherical Ice for several excellent asm routines, Neon Skylar for Pokemon data past gen 3, YAPE while it lasted, Scizz, Knizz, darthatron's numerous tools, hackmew, Chronosplit.

Altered Emerald is very old. Its final patch marks about 9 years since I started meddling with the Emerald rom. I won't forget it, but I think it makes sense to call it a wrap. This game is in a good state, with only difficult and mundane bugs remaining. Any further changes to Pokémon are left as an exercise to the reader.
After all, you have the roms.ini files, and Gamer2020's PGE, and access to the full force of the disassembly's documentation. Go screw up my game for me? Or better yet, steal my ideas, and make them your own?

Thanks for all the years. I am still blown away by the response this got.
And cut!
Reply With Quote
  #1360   Link to this post, but load the entire thread.  
Old June 5th, 2018 (6:39 AM). Edited June 5th, 2018 by Spherical Ice.
Spherical Ice's Avatar
Spherical Ice Spherical Ice is offline
 
Join Date: Nov 2007
Location: Leicester, UK
Age: 25
Posts: 5,251
Quote:
Originally Posted by luuma View Post
That would be awesome but it's not something I really need that much. I can just put it in as a bug report honestly. twelve years down the line we'll maybe see some poor soul on the wayback machine losing a high level pokemon to whatever trash they were ev grinding

Alright to get my deletion routine I've just changed cmp r6 #6 to cmp r6 #0. Not exactly efficient but it's a neat trick for anyone who wants all but their first mon to get deleted at some point (like I do).

Many thanks for routine 2, it is a beaut!
I've rewritten routine 1 and it seems like it's working properly now, from the tests I've done.

Code:
.thumb

main:
    push {r4-r7, lr}
    ldr r0, =(0x020370D0) @ var_800D
    ldrh r0, [r0]
    sub r0, #2 @ party size - 1
    mov r4, r0
    mov r5, #0
    
box_loop:
    mov r6, #0 @ box_id
    mov r7, #0 @ pos_in_box
    
pokemon_in_box_loop:
    mov r0, r6
    mov r1, r7
    ldr r3, =(0x0808BD30+1) @ pokemon_by_box_and_position
    bl call_via_r3
    mov r1, #0xB @ req_species
    ldr r3, =(0x0803FD44+1) @ pokemon_getattr_encrypted
    bl call_via_r3
    cmp r0, #0
    beq empty_space_found

next_loop:
    add r7, #1
    cmp r7, #30
    bls pokemon_in_box_loop

completed_current_box:
    add r6, #1
    cmp r6, #14
    bge not_enough_space
    mov r7, #0
    b pokemon_in_box_loop

empty_space_found:
    add r5, #1
    cmp r5, r4
    bls next_loop

enough_space:
    mov r0, #1
    b end
    
not_enough_space:
    mov r0, #0
    
end:
    ldr r1, =(0x020370D0) @ var_800D
    str r0, [r1]
    pop {r4-r7}
    pop {r3}

call_via_r3:
    bx r3

.pool
I've updated my initial post with the routines as well. You should be able to port this to Emerald quite easily.
__________________
Reply With Quote
  #1361   Link to this post, but load the entire thread.  
Old June 5th, 2018 (9:48 AM).
luuma's Avatar
luuma luuma is offline
searching for Meaning, offering HA numel
 
Join Date: Nov 2013
Location: Stage Left
Age: 26
Gender: Male
Posts: 162
Quote:
Originally Posted by Spherical Ice View Post
I've rewritten routine 1 and it seems like it's working properly now, from the tests I've done.
Awesome job! Here it is for emerald, and it also works perfectly here as far as I can tell.
Code:
.thumb

main:
    push {r4-r7, lr}
    ldr r0, =(0x020375f0) @ var_800D
    ldrh r0, [r0]
    sub r0, #2 @ party size - 1
    mov r4, r0
    mov r5, #0
    
box_loop:
    mov r6, #0 @ box_id
    mov r7, #0 @ pos_in_box
    
pokemon_in_box_loop:
    mov r0, r6
    mov r1, r7
    ldr r3, =(0x080d2094+1) @ pokemon_by_box_and_position (getboxedmonptr)
    bl call_via_r3
    mov r1, #0xB @ req_species
    ldr r3, =(0x0806a674+1) @ pokemon_getattr_encrypted (getboxmondata)
    bl call_via_r3
    cmp r0, #0
    beq empty_space_found

next_loop:
    add r7, #1
    cmp r7, #30
    bls pokemon_in_box_loop

completed_current_box:
    add r6, #1
    cmp r6, #14
    bge not_enough_space
    mov r7, #0
    b pokemon_in_box_loop

empty_space_found:
    add r5, #1
    cmp r5, r4
    bls next_loop

enough_space:
    mov r0, #1
    b end
    
not_enough_space:
    mov r0, #0
    
end:
    ldr r1, =(0x020375f0) @ var_800D
    str r0, [r1]
    pop {r4-r7}
    pop {r3}

call_via_r3:
    bx r3

.pool
__________________
Play Altered Emerald here!

Thanks to DizzyEgg, Lunos and the EBEU team for the battle engine, features, dynamic expansion, and the mind-bogglingly excellent disassembly project, lu-ho for a-map, Gamer2020 for pge, about 5 different hex editors, especially HexEdit which didn't suck, Microsoft Windows for Task Manager, Chaos rush for sprites and an animation disable tutorial, Spherical Ice for several excellent asm routines, Neon Skylar for Pokemon data past gen 3, YAPE while it lasted, Scizz, Knizz, darthatron's numerous tools, hackmew, Chronosplit.

Altered Emerald is very old. Its final patch marks about 9 years since I started meddling with the Emerald rom. I won't forget it, but I think it makes sense to call it a wrap. This game is in a good state, with only difficult and mundane bugs remaining. Any further changes to Pokémon are left as an exercise to the reader.
After all, you have the roms.ini files, and Gamer2020's PGE, and access to the full force of the disassembly's documentation. Go screw up my game for me? Or better yet, steal my ideas, and make them your own?

Thanks for all the years. I am still blown away by the response this got.
And cut!
Reply With Quote
  #1362   Link to this post, but load the entire thread.  
Old June 11th, 2018 (1:53 AM). Edited June 11th, 2018 by Lancekoijerwillborough.
Lancekoijerwillborough Lancekoijerwillborough is offline
 
Join Date: Jan 2017
Gender: Male
Posts: 41
Quote:
Originally Posted by chestertagat View Post
I don't know if anyone here has already posted this one,
But i'm sure someone researched this and used it in their hack. (BTW It's Glazed if you don't know)
Credits to: TheCreatorofGlazed for the wonderful Idea, BluRose for the Initialization and Touched Sensei for everything else.

Here it is:

[FR] Text Display Input Routine
Basically what this do is get an input from user via naming_function and stores it somewhere in the ram then compare it to some string you can define.

Note: I'm not GOOD at ASM so don't judge me if i said something wrong or explained something wrong. Please point it out instead . It's just that those ones who I asked to help me are very GOOOOOOOOOOOOD at ASM.
Routine:
Spoiler:
Code:
.text
.align 2

main:
        push {r4, lr}
        sub sp, #8 
        mov r0, #0x4              @Type: 0-4 , 4=rival 3=Pokemon
        ldr r1, fcode_buffer
        mov r2, #0
        mov r3, #0
        mov r4, #0
        str r4, [sp]
        adr r4, continue
		add r4, #1
        str r4, [sp, #4]
        ldr r4, display_text
        bl call_via_r4
        add sp, #8
        pop {r4, pc}

.align 2
display_text: .word 0x0809d954|1


continue:
        push {r4, lr}
        ldr r0,fcode_buffer
        ldr r1, real_password
        ldr r1, [r1]
		ldr r4, strcomp
        bl call_via_r4
        cmp r0, #0
        beq matched
        mov r0, #0
        b return

matched:
        mov r0, #1

return:
		ldr r1, var_800D
        strh r0, [r1]
        ldr r4, =0x080568E0|1
        bl call_via_r4
        pop {r4, pc}

call_via_r4:
        bx r4

.align 2
strcomp:      .word 0x08008E28|1
fcode_buffer: .word 0x02021CE0
real_password:.word 0x03000EB0+0x64
var_800D:     .word 0x020370D0

Instruction:
Spoiler:

You can define your password by putting :
loadpointer 0 @password
before the callasm. (note: you can't set your password more than the max Characters in the Input or else it will fail)
#org @password
= yourpass (yes you treat it like a msgstring and also remember the note above)
and what does this do if the input matches your password?
it sets var 0x800D to 1
and if not ViceVersa
and also. instead of defining the password on your script , you can point it out at any address in the rom as long as it's a string that is not more than the max input char.
you can do that by changing the label real_password to the address of your password.

That's it .
and another one , You can also change the "Rival's Name" text or "PKMN name" if you found out how to do that . It'll be really helpful :)
This Routine can be used for many things not just for Password System. You can use it to name People in your game , It's up to you.

and also feel free to ask what is what :D
Hello everyone, I edited this routine to support the byte manipulation using vars so we don't have to shift bits just for us to use icon above 0xFF.

Spoiler:

Code:
.text
.align 2

main:
        push {r4, lr}
        sub sp, #8 
        ldr r0, var_8000              @set this to 0x1 or 0x2 for Pokemon_nicknaming and 0x4 for rival (if you change it to Rival im not sure if it will require additional args)
	ldrb r0, [r0]      
	ldr r1, fcode_buffer
        ldr r2, var_8001
	ldrh r2, [r2]
        mov r3, #0
        mov r4, #0
        str r4, [sp]
        adr r4, continue
	add r4, #1
        str r4, [sp, #4]
        ldr r4, display_text
        bl call_via_r4
        add sp, #8
        pop {r4, pc}

.align 2
display_text: .word 0x0809d954|1


continue:
        push {r4, lr}
        ldr r0,fcode_buffer
        ldr r1, real_password
        ldr r1, [r1]
		ldr r4, strcomp
        bl call_via_r4
        cmp r0, #0
        beq matched
        mov r0, #0
        b return

matched:
        mov r0, #1

return:
		ldr r1, var_800D
        strh r0, [r1]
        ldr r4, =0x080568E0|1
        bl call_via_r4
        pop {r4, pc}

call_via_r4:
        bx r4

.align 2
strcomp:      .word 0x08008E28|1
fcode_buffer: .word 0x02021CE0
real_password:.word 0x03000EB0+0x64
var_800D:     .word 0x020370D0
var_8000:     .word 0x020370B8
var_8001:     .word 0x020370BA


For Variable 0x8000:
set it to 3 if you want Pokemon icons to be used
set it to anything if you want other formats (do not use bytes above 0x04 if you haven't expanded the table yet)

For Variable 0x8001:
Set it to the index number of your desired Pokemon Icon.

Do not forget to add "waitstate" command after calling the ASM.

Doing this will save you some spaces as you don't have to make many routines if you are wanting for a multiple password formats.

All credits goes to chestertagat and BluRose.
Reply With Quote
  #1363   Link to this post, but load the entire thread.  
Old June 20th, 2018 (6:17 PM).
UltimaSoul UltimaSoul is offline
 
Join Date: May 2018
Posts: 53
Quote:
Originally Posted by Xencleamas View Post
I have modified and enhanced azurile13's (credits and kudos to him) routine to make this supported on the Compiler's THUMB.bat. These are the things I modified:
  • Added routines creating the hooks that are to be copy-pasted on their respective locations. There are 11 hooks.
  • Added the master location of the routine in which the hooks will create locations for those routines. Insert your free space on .equ MyLoc. Format: 0x###### (Hexadecimal Number)
  • Created and added a new index list of Pokémon up to Generation VI including the formes in style of KDS/Chacha Dinosaur from the filenames of MrDollSteak's sprites in his Sugimori and Gen VI threads. I think there is no master index list for Generation VII. If there is, please PM me and I will add those.
  • With the list created as stated above, you will just have to create your own Regional Pokédex by copy-pasting from your Excel and Notepad file to below "regional_dex_order" and .hword 0x0000 should be first in the list. Make sure the names are all CAPS-LOCKED. In case of Nidorans, Farfetch'd, Mr. Mime, Ho-Oh, Mime Jr., Porygon-Z, and Flabébé, their characters are changed so you'll have to look for them in the master list. NOTE: Cohagrigus have been filtered out and changed into asterisks (*). Remember to correct its name before generating the binary file otherwise the .asm file won't work.

Custom Regional Pokédex for FireRed:
Spoiler:
Code:
.thumb
.align

.equ number_of_mons_in_regional_dex, 202 @or however long you wanted your regional dex to be
.equ number_of_mons_in_national_dex, 386
.equ MyLoc, 0x888888 @insert your location here
.equ RomAreaOffset,	0x8000000

@Kanto

.equ UNKNOWN, 0x0
.equ BULBASAUR, 0x1
.equ IVYSAUR, 0x2
.equ VENUSAUR, 0x3
.equ CHARMANDER, 0x4
.equ CHARMELEON, 0x5
.equ CHARIZARD, 0x6
.equ SQUIRTLE, 0x7
.equ WARTORTLE, 0x8
.equ BLASTOISE, 0x9
.equ CATERPIE, 0xA
.equ METAPOD, 0xB
.equ BUTTERFREE, 0xC
.equ WEEDLE, 0xD
.equ KAKUNA, 0xE
.equ BEEDRILL, 0xF
.equ PIDGEY, 0x10
.equ PIDGEOTTO, 0x11
.equ PIDGEOT, 0x12
.equ RATTATA, 0x13
.equ RATICATE, 0x14
.equ SPEAROW, 0x15
.equ FEAROW, 0x16
.equ EKANS, 0x17
.equ ARBOK, 0x18
.equ PIKACHU, 0x19
.equ RAICHU, 0x1A
.equ SANDSHREW, 0x1B
.equ SANDSLASH, 0x1C
.equ NIDORAN_F, 0x1D
.equ NIDORINA, 0x1E
.equ NIDOQUEEN, 0x1F
.equ NIDORAN_M, 0x20
.equ NIDORINO, 0x21
.equ NIDOKING, 0x22
.equ CLEFAIRY, 0x23
.equ CLEFABLE, 0x24
.equ VULPIX, 0x25
.equ NINETALES, 0x26
.equ JIGGLYPUFF, 0x27
.equ WIGGLYTUFF, 0x28
.equ ZUBAT, 0x29
.equ GOLBAT, 0x2A
.equ ODDISH, 0x2B
.equ GLOOM, 0x2C
.equ VILEPLUME, 0x2D
.equ PARAS, 0x2E
.equ PARASECT, 0x2F
.equ VENONAT, 0x30
.equ VENOMOTH, 0x31
.equ DIGLETT, 0x32
.equ DUGTRIO, 0x33
.equ MEOWTH, 0x34
.equ PERSIAN, 0x35
.equ PSYDUCK, 0x36
.equ GOLDUCK, 0x37
.equ MANKEY, 0x38
.equ PRIMEAPE, 0x39
.equ GROWLITHE, 0x3A
.equ ARCANINE, 0x3B
.equ POLIWAG, 0x3C
.equ POLIWHIRL, 0x3D
.equ POLIWRATH, 0x3E
.equ ABRA, 0x3F
.equ KADABRA, 0x40
.equ ALAKAZAM, 0x41
.equ MACHOP, 0x42
.equ MACHOKE, 0x43
.equ MACHAMP, 0x44
.equ BELLSPROUT, 0x45
.equ WEEPINBELL, 0x46
.equ VICTREEBEL, 0x47
.equ TENTACOOL, 0x48
.equ TENTACRUEL, 0x49
.equ GEODUDE, 0x4A
.equ GRAVELER, 0x4B
.equ GOLEM, 0x4C
.equ PONYTA, 0x4D
.equ RAPIDASH, 0x4E
.equ SLOWPOKE, 0x4F
.equ SLOWBRO, 0x50
.equ MAGNEMITE, 0x51
.equ MAGNETON, 0x52
.equ FARFETCH_D, 0x53
.equ DODUO, 0x54
.equ DODRIO, 0x55
.equ SEEL, 0x56
.equ DEWGONG, 0x57
.equ GRIMER, 0x58
.equ MUK, 0x59
.equ SHELLDER, 0x5A
.equ CLOYSTER, 0x5B
.equ GASTLY, 0x5C
.equ HAUNTER, 0x5D
.equ GENGAR, 0x5E
.equ ONIX, 0x5F
.equ DROWZEE, 0x60
.equ HYPNO, 0x61
.equ KRABBY, 0x62
.equ KINGLER, 0x63
.equ VOLTORB, 0x64
.equ ELECTRODE, 0x65
.equ EXEGGCUTE, 0x66
.equ EXEGGUTOR, 0x67
.equ CUBONE, 0x68
.equ MAROWAK, 0x69
.equ HITMONLEE, 0x6A
.equ HITMONCHAN, 0x6B
.equ LICKITUNG, 0x6C
.equ KOFFING, 0x6D
.equ WEEZING, 0x6E
.equ RHYHORN, 0x6F
.equ RHYDON, 0x70
.equ CHANSEY, 0x71
.equ TANGELA, 0x72
.equ KANGASKHAN, 0x73
.equ HORSEA, 0x74
.equ SEADRA, 0x75
.equ GOLDEEN, 0x76
.equ SEAKING, 0x77
.equ STARYU, 0x78
.equ STARMIE, 0x79
.equ MR_MIME, 0x7A
.equ SCYTHER, 0x7B
.equ JYNX, 0x7C
.equ ELECTABUZZ, 0x7D
.equ MAGMAR, 0x7E
.equ PINSIR, 0x7F
.equ TAUROS, 0x80
.equ MAGIKARP, 0x81
.equ GYARADOS, 0x82
.equ LAPRAS, 0x83
.equ DITTO, 0x84
.equ EEVEE, 0x85
.equ VAPOREON, 0x86
.equ JOLTEON, 0x87
.equ FLAREON, 0x88
.equ PORYGON, 0x89
.equ OMANYTE, 0x8A
.equ OMASTAR, 0x8B
.equ KABUTO, 0x8C
.equ KABUTOPS, 0x8D
.equ AERODACTYL, 0x8E
.equ SNORLAX, 0x8F
.equ ARTICUNO, 0x90
.equ ZAPDOS, 0x91
.equ MOLTRES, 0x92
.equ DRATINI, 0x93
.equ DRAGONAIR, 0x94
.equ DRAGONITE, 0x95
.equ MEWTWO, 0x96
.equ MEW, 0x97
.equ CHIKORITA, 0x98
.equ BAYLEEF, 0x99
.equ MEGANIUM, 0x9A
.equ CYNDAQUIL, 0x9B
.equ QUILAVA, 0x9C
.equ TYPHLOSION, 0x9D
.equ TOTODILE, 0x9E
.equ CROCONAW, 0x9F
.equ FERALIGATR, 0xA0
.equ SENTRET, 0xA1
.equ FURRET, 0xA2
.equ HOOTHOOT, 0xA3
.equ NOCTOWL, 0xA4
.equ LEDYBA, 0xA5
.equ LEDIAN, 0xA6
.equ SPINARAK, 0xA7
.equ ARIADOS, 0xA8
.equ CROBAT, 0xA9
.equ CHINCHOU, 0xAA
.equ LANTURN, 0xAB
.equ PICHU, 0xAC
.equ CLEFFA, 0xAD
.equ IGGLYBUFF, 0xAE
.equ TOGEPI, 0xAF
.equ TOGETIC, 0xB0
.equ NATU, 0xB1
.equ XATU, 0xB2
.equ MAREEP, 0xB3
.equ FLAAFFY, 0xB4
.equ AMPHAROS, 0xB5
.equ BELLOSSOM, 0xB6
.equ MARILL, 0xB7
.equ AZUMARILL, 0xB8
.equ SUDOWOODO, 0xB9
.equ POLITOED, 0xBA
.equ HOPPIP, 0xBB
.equ SKIPLOOM, 0xBC
.equ JUMPLUFF, 0xBD
.equ AIPOM, 0xBE
.equ SUNKERN, 0xBF
.equ SUNFLORA, 0xC0
.equ YANMA, 0xC1
.equ WOOPER, 0xC2
.equ QUAGSIRE, 0xC3
.equ ESPEON, 0xC4
.equ UMBREON, 0xC5
.equ MURKROW, 0xC6
.equ SLOWKING, 0xC7
.equ MISDREAVUS, 0xC8
.equ UNOWN, 0xC9
.equ WOBBUFFET, 0xCA
.equ GIRAFARIG, 0xCB
.equ PINECO, 0xCC
.equ FORRETRESS, 0xCD
.equ DUNSPARCE, 0xCE
.equ GLIGAR, 0xCF
.equ STEELIX, 0xD0
.equ SNUBBULL, 0xD1
.equ GRANBULL, 0xD2
.equ QWILFISH, 0xD3
.equ SCIZOR, 0xD4
.equ SHUCKLE, 0xD5
.equ HERACROSS, 0xD6
.equ SNEASEL, 0xD7
.equ TEDDIURSA, 0xD8
.equ URSARING, 0xD9
.equ SLUGMA, 0xDA
.equ MAGCARGO, 0xDB
.equ SWINUB, 0xDC
.equ PILOSWINE, 0xDD
.equ CORSOLA, 0xDE
.equ REMORAID, 0xDF
.equ OCTILLERY, 0xE0
.equ DELIBIRD, 0xE1
.equ MANTINE, 0xE2
.equ SKARMORY, 0xE3
.equ HOUNDOUR, 0xE4
.equ HOUNDOOM, 0xE5
.equ KINGDRA, 0xE6
.equ PHANPY, 0xE7
.equ DONPHAN, 0xE8
.equ PORYGON2, 0xE9
.equ STANTLER, 0xEA
.equ SMEARGLE, 0xEB
.equ TYROGUE, 0xEC
.equ HITMONTOP, 0xED
.equ SMOOCHUM, 0xEE
.equ ELEKID, 0xEF
.equ MAGBY, 0xF0
.equ MILTANK, 0xF1
.equ BLISSEY, 0xF2
.equ RAIKOU, 0xF3
.equ ENTEI, 0xF4
.equ SUICUNE, 0xF5
.equ LARVITAR, 0xF6
.equ PUPITAR, 0xF7
.equ TYRANITAR, 0xF8
.equ LUGIA, 0xF9
.equ HO_OH, 0xFA
.equ CELEBI, 0xFB
.equ NOPE, 0xFC
.equ NOPE, 0xFD
.equ NOPE, 0xFE
.equ NOPE, 0xFF
.equ NOPE, 0x100
.equ NOPE, 0x101
.equ NOPE, 0x102
.equ NOPE, 0x103
.equ NOPE, 0x104
.equ NOPE, 0x105
.equ NOPE, 0x106
.equ NOPE, 0x107
.equ NOPE, 0x108
.equ NOPE, 0x109
.equ NOPE, 0x10A
.equ NOPE, 0x10B
.equ NOPE, 0x10C
.equ NOPE, 0x10D
.equ NOPE, 0x10E
.equ NOPE, 0x10F
.equ NOPE, 0x110
.equ NOPE, 0x111
.equ NOPE, 0x112
.equ NOPE, 0x113
.equ NOPE, 0x114
.equ TREECKO, 0x115
.equ GROVYLE, 0x116
.equ SCEPTILE, 0x117
.equ TORCHIC, 0x118
.equ COMBUSKEN, 0x119
.equ BLAZIKEN, 0x11A
.equ MUDKIP, 0x11B
.equ MARSHTOMP, 0x11C
.equ SWAMPERT, 0x11D
.equ POOCHYENA, 0x11E
.equ MIGHTYENA, 0x11F
.equ ZIGZAGOON, 0x120
.equ LINOONE, 0x121
.equ WURMPLE, 0x122
.equ SILCOON, 0x123
.equ BEAUTIFLY, 0x124
.equ CASCOON, 0x125
.equ DUSTOX, 0x126
.equ LOTAD, 0x127
.equ LOMBRE, 0x128
.equ LUDICOLO, 0x129
.equ SEEDOT, 0x12A
.equ NUZLEAF, 0x12B
.equ SHIFTRY, 0x12C
.equ NINCADA, 0x12D
.equ NINJASK, 0x12E
.equ SHEDINJA, 0x12F
.equ TAILLOW, 0x130
.equ SWELLOW, 0x131
.equ SHROOMISH, 0x132
.equ BRELOOM, 0x133
.equ SPINDA, 0x134
.equ WINGULL, 0x135
.equ PELIPPER, 0x136
.equ SURSKIT, 0x137
.equ MASQUERAIN, 0x138
.equ WAILMER, 0x139
.equ WAILORD, 0x13A
.equ SKITTY, 0x13B
.equ DELCATTY, 0x13C
.equ KECLEON, 0x13D
.equ BALTOY, 0x13E
.equ CLAYDOL, 0x13F
.equ NOSEPASS, 0x140
.equ TORKOAL, 0x141
.equ SABLEYE, 0x142
.equ BARBOACH, 0x143
.equ WHISCASH, 0x144
.equ LUVDISC, 0x145
.equ CORPHISH, 0x146
.equ CRAWDAUNT, 0x147
.equ FEEBAS, 0x148
.equ MILOTIC, 0x149
.equ CARVANHA, 0x14A
.equ SHARPEDO, 0x14B
.equ TRAPINCH, 0x14C
.equ VIBRAVA, 0x14D
.equ FLYGON, 0x14E
.equ MAKUHITA, 0x14F
.equ HARIYAMA, 0x150
.equ ELECTRIKE, 0x151
.equ MANECTRIC, 0x152
.equ NUMEL, 0x153
.equ CAMERUPT, 0x154
.equ SPHEAL, 0x155
.equ SEALEO, 0x156
.equ WALREIN, 0x157
.equ CACNEA, 0x158
.equ CACTURNE, 0x159
.equ SNORUNT, 0x15A
.equ GLALIE, 0x15B
.equ LUNATONE, 0x15C
.equ SOLROCK, 0x15D
.equ AZURILL, 0x15E
.equ SPOINK, 0x15F
.equ GRUMPIG, 0x160
.equ PLUSLE, 0x161
.equ MINUN, 0x162
.equ MAWILE, 0x163
.equ MEDITITE, 0x164
.equ MEDICHAM, 0x165
.equ SWABLU, 0x166
.equ ALTARIA, 0x167
.equ WYNAUT, 0x168
.equ DUSKULL, 0x169
.equ DUSCLOPS, 0x16A
.equ ROSELIA, 0x16B
.equ SLAKOTH, 0x16C
.equ VIGOROTH, 0x16D
.equ SLAKING, 0x16E
.equ GULPIN, 0x16F
.equ SWALOT, 0x170
.equ TROPIUS, 0x171
.equ WHISMUR, 0x172
.equ LOUDRED, 0x173
.equ EXPLOUD, 0x174
.equ CLAMPERL, 0x175
.equ HUNTAIL, 0x176
.equ GOREBYSS, 0x177
.equ ABSOL, 0x178
.equ SHUPPET, 0x179
.equ BANETTE, 0x17A
.equ SEVIPER, 0x17B
.equ ZANGOOSE, 0x17C
.equ RELICANTH, 0x17D
.equ ARON, 0x17E
.equ LAIRON, 0x17F
.equ AGGRON, 0x180
.equ CASTFORM, 0x181
.equ VOLBEAT, 0x182
.equ ILLUMISE, 0x183
.equ LILEEP, 0x184
.equ CRADILY, 0x185
.equ ANORITH, 0x186
.equ ARMALDO, 0x187
.equ RALTS, 0x188
.equ KIRLIA, 0x189
.equ GARDEVOIR, 0x18A
.equ BAGON, 0x18B
.equ SHELGON, 0x18C
.equ SALAMENCE, 0x18D
.equ BELDUM, 0x18E
.equ METANG, 0x18F
.equ METAGROSS, 0x190
.equ REGIROCK, 0x191
.equ REGICE, 0x192
.equ REGISTEEL, 0x193
.equ KYOGRE, 0x194
.equ GROUDON, 0x195
.equ RAYQUAZA, 0x196
.equ LATIAS, 0x197
.equ LATIOS, 0x198
.equ JIRACHI, 0x199
.equ DEOXYS, 0x19A
.equ CHIMECHO, 0x19B
.equ EGG, 0x19C
.equ UNOWN_B, 0x19D
.equ UNOWN_C, 0x19E
.equ UNOWN_D, 0x19F
.equ UNOWN_E, 0x1A0
.equ UNOWN_F, 0x1A1
.equ UNOWN_G, 0x1A2
.equ UNOWN_H, 0x1A3
.equ UNOWN_I, 0x1A4
.equ UNOWN_J, 0x1A5
.equ UNOWN_K, 0x1A6
.equ UNOWN_L, 0x1A7
.equ UNOWN_M, 0x1A8
.equ UNOWN_N, 0x1A9
.equ UNOWN_O, 0x1AA
.equ UNOWN_P, 0x1AB
.equ UNOWN_Q, 0x1AC
.equ UNOWN_R, 0x1AD
.equ UNOWN_S, 0x1AE
.equ UNOWN_T, 0x1AF
.equ UNOWN_U, 0x1B0
.equ UNOWN_V, 0x1B1
.equ UNOWN_W, 0x1B2
.equ UNOWN_X, 0x1B3
.equ UNOWN_Y, 0x1B4
.equ UNOWN_Z, 0x1B5
.equ UNOWN_EXCLAMATION, 0x1B6
.equ UNOWN_QUESTION, 0x1B7
.equ TURTWIG, 0x1B8
.equ GROTLE, 0x1B9
.equ TORTERRA, 0x1BA
.equ CHIMCHAR, 0x1BB
.equ MONFERNO, 0x1BC
.equ INFERNAPE, 0x1BD
.equ PIPLUP, 0x1BE
.equ PRINPLUP, 0x1BF
.equ EMPOLEON, 0x1C0
.equ STARLY, 0x1C1
.equ STARAVIA, 0x1C2
.equ STARAPTOR, 0x1C3
.equ BIDOOF, 0x1C4
.equ BIBAREL, 0x1C5
.equ KRICKETOT, 0x1C6
.equ KRICKETUNE, 0x1C7
.equ SHINX, 0x1C8
.equ LUXIO, 0x1C9
.equ LUXRAY, 0x1CA
.equ BUDEW, 0x1CB
.equ ROSERADE, 0x1CC
.equ CRANIDOS, 0x1CD
.equ RAMPARDOS, 0x1CE
.equ SHIELDON, 0x1CF
.equ BASTIODON, 0x1D0
.equ BURMY, 0x1D1
.equ WORMADAM, 0x1D2
.equ MOTHIM, 0x1D3
.equ COMBEE, 0x1D4
.equ VESPIQUEN, 0x1D5
.equ PACHIRISU, 0x1D6
.equ BUIZEL, 0x1D7
.equ FLOATZEL, 0x1D8
.equ CHERUBI, 0x1D9
.equ CHERRIM, 0x1DA
.equ SHELLOS, 0x1DB
.equ GASTRODON, 0x1DC
.equ AMBIPOM, 0x1DD
.equ DRIFLOON, 0x1DE
.equ DRIFBLIM, 0x1DF
.equ BUNEARY, 0x1E0
.equ LOPUNNY, 0x1E1
.equ MISMAGIUS, 0x1E2
.equ HONCHKROW, 0x1E3
.equ GLAMEOW, 0x1E4
.equ PURUGLY, 0x1E5
.equ CHINGLING, 0x1E6
.equ STUNKY, 0x1E7
.equ SKUNTANK, 0x1E8
.equ BRONZOR, 0x1E9
.equ BRONZONG, 0x1EA
.equ BONSLY, 0x1EB
.equ MIME_JR, 0x1EC
.equ HAPPINY, 0x1ED
.equ CHATOT, 0x1EE
.equ SPIRITOMB, 0x1EF
.equ GIBLE, 0x1F0
.equ GABITE, 0x1F1
.equ GARCHOMP, 0x1F2
.equ MUNCHLAX, 0x1F3
.equ RIOLU, 0x1F4
.equ LUCARIO, 0x1F5
.equ HIPPOPOTAS, 0x1F6
.equ HIPPOWDON, 0x1F7
.equ SKORUPI, 0x1F8
.equ DRAPION, 0x1F9
.equ CROAGUNK, 0x1FA
.equ TOXICROAK, 0x1FB
.equ CARNIVINE, 0x1FC
.equ FINNEON, 0x1FD
.equ LUMINEON, 0x1FE
.equ MANTYKE, 0x1FF
.equ SNOVER, 0x200
.equ ABOMASNOW, 0x201
.equ WEAVILE, 0x202
.equ MAGNEZONE, 0x203
.equ LICKILICKY, 0x204
.equ RHYPERIOR, 0x205
.equ TANGROWTH, 0x206
.equ ELECTIVIRE, 0x207
.equ MAGMORTAR, 0x208
.equ TOGEKISS, 0x209
.equ YANMEGA, 0x20A
.equ LEAFEON, 0x20B
.equ GLACEON, 0x20C
.equ GLISCOR, 0x20D
.equ MAMOSWINE, 0x20E
.equ PORYGON_Z, 0x20F
.equ GALLADE, 0x210
.equ PROBOPASS, 0x211
.equ DUSKNOIR, 0x212
.equ FROSLASS, 0x213
.equ ROTOM, 0x214
.equ UXIE, 0x215
.equ MESPRIT, 0x216
.equ AZELF, 0x217
.equ DIALGA, 0x218
.equ PALKIA, 0x219
.equ HEATRAN, 0x21A
.equ REGIGIGAS, 0x21B
.equ GIRATINA, 0x21C
.equ CRESSELIA, 0x21D
.equ PHIONE, 0x21E
.equ MANAPHY, 0x21F
.equ DARKRAI, 0x220
.equ SHAYMIN, 0x221
.equ ARCEUS, 0x222
.equ BURMY_SAND, 0x223
.equ BURMY_TRASH, 0x224
.equ WORMADAM_SAND, 0x225
.equ WORMADAM_THRASH, 0x226
.equ SHELLOS_EAST, 0x227
.equ GASTRODON_EAST, 0x228
.equ ROTOM_HEAT, 0x229
.equ ROTOM_WASH, 0x22A
.equ ROTOM_FROST, 0x22B
.equ ROTOM_FAN, 0x22C
.equ ROTOM_MOW, 0x22D
.equ GIRATINA_ORIGIN, 0x22E
.equ SHAYMIN_SKY, 0x22F
.equ ARCEUS_FIGHT, 0x230
.equ ARCEUS_FLYING, 0x231
.equ ARCEUS_POISON, 0x232
.equ ARCEUS_GROUND, 0x233
.equ ARCEUS_ROCK, 0x234
.equ ARCEUS_BUG, 0x235
.equ ARCEUS_GHOST, 0x236
.equ ARCEUS_STEEL, 0x237
.equ ARCEUS_UNKNOWN, 0x238
.equ ARCEUS_FIRE, 0x239
.equ ARCEUS_WATER, 0x23A
.equ ARCEUS_GRASS, 0x23B
.equ ARCEUS_ELECTRIC, 0x23C
.equ ARCEUS_PSYCHIC, 0x23D
.equ ARCEUS_ICE, 0x23E
.equ ARCEUS_DRAGON, 0x23F
.equ ARCEUS_DARK, 0x240
.equ ARCEUS_FAIRY, 0x241
.equ VICTINI, 0x242
.equ SNIVY, 0x243
.equ SERVINE, 0x244
.equ SERPERIOR, 0x245
.equ TEPIG, 0x246
.equ PIGNITE, 0x247
.equ EMBOAR, 0x248
.equ OSHAWOTT, 0x249
.equ DEWOTT, 0x24A
.equ SAMUROTT, 0x24B
.equ PATRAT, 0x24C
.equ WATCHOG, 0x24D
.equ LILLIPUP, 0x24E
.equ HERDIER, 0x24F
.equ STOUTLAND, 0x250
.equ PURRLOIN, 0x251
.equ LIEPARD, 0x252
.equ PANSAGE, 0x253
.equ SIMISAGE, 0x254
.equ PANSEAR, 0x255
.equ SIMISEAR, 0x256
.equ PANPOUR, 0x257
.equ SIMIPOUR, 0x258
.equ MUNNA, 0x259
.equ MUSHARNA, 0x25A
.equ PIDOVE, 0x25B
.equ TRANQUILL, 0x25C
.equ UNFEZANT, 0x25D
.equ BLITZLE, 0x25E
.equ ZEBSTRIKA, 0x25F
.equ ROGGENROLA, 0x260
.equ BOLDORE, 0x261
.equ GIGALITH, 0x262
.equ WOOBAT, 0x263
.equ SWOOBAT, 0x264
.equ DRILBUR, 0x265
.equ EXCADRILL, 0x266
.equ AUDINO, 0x267
.equ TIMBURR, 0x268
.equ GURDURR, 0x269
.equ CONKELDURR, 0x26A
.equ TYMPOLE, 0x26B
.equ PALPITOAD, 0x26C
.equ SEISMITOAD, 0x26D
.equ THROH, 0x26E
.equ SAWK, 0x26F
.equ SEWADDLE, 0x270
.equ SWADLOON, 0x271
.equ LEAVANNY, 0x272
.equ VENIPEDE, 0x273
.equ WHIRLIPEDE, 0x274
.equ SCOLIPEDE, 0x275
.equ COTTONEE, 0x276
.equ WHIMSICOTT, 0x277
.equ PETILIL, 0x278
.equ LILLIGANT, 0x279
.equ BASCULIN, 0x27A
.equ SANDILE, 0x27B
.equ KROKOROK, 0x27C
.equ KROOKODILE, 0x27D
.equ DARUMAKA, 0x27E
.equ DARMANITAN, 0x27F
.equ MARACTUS, 0x280
.equ DWEBBLE, 0x281
.equ CRUSTLE, 0x282
.equ SCRAGGY, 0x283
.equ SCRAFTY, 0x284
.equ SIGILYPH, 0x285
.equ YAMASK, 0x286
.equ COHAGRIGUS, 0x287
.equ TIRTOUGA, 0x288
.equ CARRACOSTA, 0x289
.equ ARCHEN, 0x28A
.equ ARCHEOPS, 0x28B
.equ TRUBBISH, 0x28C
.equ GARBODOR, 0x28D
.equ ZORUA, 0x28E
.equ ZOROARK, 0x28F
.equ MINCCINO, 0x290
.equ CINCCINO, 0x291
.equ GOTHITA, 0x292
.equ GOTHORITA, 0x293
.equ GOTHITELLE, 0x294
.equ SOLOSIS, 0x295
.equ DUOSION, 0x296
.equ REUNICLUS, 0x297
.equ DUCKLETT, 0x298
.equ SWANNA, 0x299
.equ VANILLITE, 0x29A
.equ VANILLISH, 0x29B
.equ VANILLUXE, 0x29C
.equ DEERLING, 0x29D
.equ SAWSBUCK, 0x29E
.equ EMOLGA, 0x29F
.equ KARRABLAST, 0x2A0
.equ ESCAVALIER, 0x2A1
.equ FOONGUS, 0x2A2
.equ AMOONGUSS, 0x2A3
.equ FRILLISH, 0x2A4
.equ JELLICENT, 0x2A5
.equ ALOMOMOLA, 0x2A6
.equ JOLTIK, 0x2A7
.equ GALVANTULA, 0x2A8
.equ FERROSEED, 0x2A9
.equ FERROTHORN, 0x2AA
.equ KLINK, 0x2AB
.equ KLANG, 0x2AC
.equ KLINKLANG, 0x2AD
.equ TYNAMO, 0x2AE
.equ EELEKTRIK, 0x2AF
.equ EELEKTROSS, 0x2B0
.equ ELGYEM, 0x2B1
.equ BEHEEYEM, 0x2B2
.equ LITWICK, 0x2B3
.equ LAMPENT, 0x2B4
.equ CHANDELURE, 0x2B5
.equ AXEW, 0x2B6
.equ FRAXURE, 0x2B7
.equ HAXORUS, 0x2B8
.equ CUBCHOO, 0x2B9
.equ BEARTIC, 0x2BA
.equ CRYOGONAL, 0x2BB
.equ SHELMET, 0x2BC
.equ ACCELGOR, 0x2BD
.equ STUNFISK, 0x2BE
.equ MIENFOO, 0x2BF
.equ MIENSHAO, 0x2C0
.equ DRUDDIGON, 0x2C1
.equ GOLETT, 0x2C2
.equ GOLURK, 0x2C3
.equ PAWNIARD, 0x2C4
.equ BISHARP, 0x2C5
.equ BOUFFALANT, 0x2C6
.equ RUFFLET, 0x2C7
.equ BRAVIARY, 0x2C8
.equ VULLABY, 0x2C9
.equ MANDIBUZZ, 0x2CA
.equ HEATMOR, 0x2CB
.equ DURANT, 0x2CC
.equ DEINO, 0x2CD
.equ ZWEILOUS, 0x2CE
.equ HYDREIGON, 0x2CF
.equ LARVESTA, 0x2D0
.equ VOLCARONA, 0x2D1
.equ COBALION, 0x2D2
.equ TERRAKION, 0x2D3
.equ VIRIZION, 0x2D4
.equ TORNADUS, 0x2D5
.equ THUNDURUS, 0x2D6
.equ RESHIRAM, 0x2D7
.equ ZEKROM, 0x2D8
.equ LANDORUS, 0x2D9
.equ KYUREM, 0x2DA
.equ KELDEO, 0x2DB
.equ MELOETTA, 0x2DC
.equ GENESECT, 0x2DD
.equ BASCULIN_BLUE, 0x2DE
.equ DARMANITAN_ZEN, 0x2DF
.equ DEERLING_SUMMER, 0x2E0
.equ DEERLING_AUTUMN, 0x2E1
.equ DEERLING_WINTER, 0x2E2
.equ SAWSBUCK_SUMMER, 0x2E3
.equ SAWSBUCK_AUTUMN, 0x2E4
.equ SAWSBUCK_WINTER, 0x2E5
.equ KYUREM_WHITE, 0x2E6
.equ KYUREM_BLACK, 0x2E7
.equ MELOETTA_PIROUETTE, 0x2E8
.equ GENESECT_SHOCK, 0x2E9
.equ GENESECT_BURN, 0x2EA
.equ GENESECT_CHILL, 0x2EB
.equ GENESECT_DOUSE, 0x2EC
.equ TORNADUS_THERIAN, 0x2ED
.equ THUNDURUS_THERIAN, 0x2EE
.equ LANDORUS_THERIAN, 0x2EF
.equ KELDEO_RESOLUTE, 0x2F0
.equ CHESPIN, 0x2F1
.equ QUILLADIN, 0x2F2
.equ CHESNAUGHT, 0x2F3
.equ FENNEKIN, 0x2F4
.equ BRAIXEN, 0x2F5
.equ DELPHOX, 0x2F6
.equ FROAKIE, 0x2F7
.equ FROGADIER, 0x2F8
.equ GRENINJA, 0x2F9
.equ BUNNELBY, 0x2FA
.equ DIGGERSBY, 0x2FB
.equ FLETCHLING, 0x2FC
.equ FLETCHINDER, 0x2FD
.equ TALONFLAME, 0x2FE
.equ SCATTERBUG, 0x2FF
.equ SPEWPA, 0x300
.equ VIVILLON, 0x301
.equ LITLEO, 0x302
.equ PYROAR, 0x303
.equ FLABEBE, 0x304
.equ FLOETTE, 0x305
.equ FLORGES, 0x306
.equ SKIDDO, 0x307
.equ GOGOAT, 0x308
.equ PANCHAM, 0x309
.equ PANGORO, 0x30A
.equ FURFROU, 0x30B
.equ ESPURR, 0x30C
.equ MEOWSTIC, 0x30D
.equ HONEDGE, 0x30E
.equ DOUBLADE, 0x30F
.equ AEGISLASH, 0x310
.equ SPRITZEE, 0x311
.equ AROMATISSE, 0x312
.equ SWIRLIX, 0x313
.equ SLURPUFF, 0x314
.equ INKAY, 0x315
.equ MALAMAR, 0x316
.equ BINACLE, 0x317
.equ BARBARACLE, 0x318
.equ SKRELP, 0x319
.equ DRAGALGE, 0x31A
.equ CLAUNCHER, 0x31B
.equ CLAWITZER, 0x31C
.equ HELIOPTILE, 0x31D
.equ HELIOLISK, 0x31E
.equ TYRUNT, 0x31F
.equ TYRANTRUM, 0x320
.equ AMAURA, 0x321
.equ AURORUS, 0x322
.equ SYLVEON, 0x323
.equ HAWLUCHA, 0x324
.equ DEDENNE, 0x325
.equ CARBINK, 0x326
.equ GOOMY, 0x327
.equ SLIGGOO, 0x328
.equ GOODRA, 0x329
.equ KLEFKI, 0x32A
.equ PHANTUMP, 0x32B
.equ TREVENANT, 0x32C
.equ PUMPKABOO, 0x32D
.equ GOURGEIST, 0x32E
.equ BERGMITE, 0x32F
.equ AVALUGG, 0x330
.equ NOIBAT, 0x331
.equ NOIVERN, 0x332
.equ XERNEAS, 0x333
.equ YVELTAL, 0x334
.equ ZYGARDE, 0x335
.equ DIANCIE, 0x336
.equ HOOPA, 0x337
.equ VOLCANION, 0x338
.equ PYROAR_FEMALE, 0x339
.equ FLABEBE_WHITE, 0x33A
.equ FLABEBE_YELLOW, 0x33B
.equ FLABEBE_ORANGE, 0x33C
.equ FLABEBE_BLUE, 0x33D
.equ FLOETTE_WHITE, 0x33E
.equ FLOETTE_YELLOW, 0x33F
.equ FLOETTE_ORANGE, 0x340
.equ FLOETTE_BLUE, 0x341
.equ FLORGES_WHITE, 0x342
.equ FLORGES_YELLOW, 0x343
.equ FLORGES_ORANGE, 0x344
.equ FLORGES_BLUE, 0x345
.equ MEOWSTIC_FEMALE, 0x346
.equ AEGISLASH_BLADE, 0x347
.equ PUMPKABOO_2, 0x348
.equ PUMPKABOO_3, 0x349
.equ PUMPKABOO_4, 0x34A
.equ GOURGEIST_2, 0x34B
.equ GOURGEIST_3, 0x34C
.equ GOURGEIST_4, 0x34D
.equ HOOPA_UNBOUND, 0x34E
.equ VENUSAUR_MEGA, 0x34F
.equ CHARIZARD_MEGAX, 0x350
.equ CHARIZARD_MEGAY, 0x351
.equ BLASTOISE_MEGA, 0x352
.equ BEEDRILL_MEGA, 0x353
.equ PIDGEOT_MEGA, 0x354
.equ ALAKAZAM_MEGA, 0x355
.equ SLOWBRO_MEGA, 0x356
.equ GENGAR_MEGA, 0x357
.equ KANGASKHAN_MEGA, 0x358
.equ PINSIR_MEGA, 0x359
.equ GYARADOS_MEGA, 0x35A
.equ AERODACTYL_MEGA, 0x35B
.equ MEWTWO_MEGAX, 0x35C
.equ MEWTWO_MEGAY, 0x35D
.equ AMPHAROS_MEGA, 0x35E
.equ STEELIX_MEGA, 0x35F
.equ SCIZOR_MEGA, 0x360
.equ HERACROSS_MEGA, 0x361
.equ HOUNDOOM_MEGA, 0x362
.equ TYRANITAR_MEGA, 0x363
.equ SCEPTILE_MEGA, 0x364
.equ BLAZIKEN_MEGA, 0x365
.equ SWAMPERT_MEGA, 0x366
.equ GARDEVOIR_MEGA, 0x367
.equ SABLEYE_MEGA, 0x368
.equ MAWILE_MEGA, 0x369
.equ AGGRON_MEGA, 0x36A
.equ MEDICHAM_MEGA, 0x36B
.equ MANECTRIC_MEGA, 0x36C
.equ SHARPEDO_MEGA, 0x36D
.equ CAMERUPT_MEGA, 0x36E
.equ ALTARIA_MEGA, 0x36F
.equ BANETTE_MEGA, 0x370
.equ ABSOL_MEGA, 0x371
.equ GLALIE_MEGA, 0x372
.equ SALAMENCE_MEGA, 0x373
.equ METAGROSS_MEGA, 0x374
.equ NOPE, 0x375 @Dunno why but maybe a new Latias out from the Soul Dew routine
.equ NOPE, 0x376 @Dunno why but maybe a new Latios out from the Soul Dew routine
.equ LATIAS_MEGA, 0x377
.equ LATIOS_MEGA, 0x378
.equ RAYQUAZA_MEGA, 0x379
.equ LOPUNNY_MEGA, 0x37A
.equ GARCHOMP_MEGA, 0x37B
.equ LUCARIO_MEGA, 0x37C
.equ ABOMASNOW_MEGA, 0x37D
.equ GALLADE_MEGA, 0x37E
.equ AUDINO_MEGA, 0x37F
.equ DIANCIE_MEGA, 0x380
.equ DEOXYS_NORMAL, 0x381 @Renewal of Deoxys' index
.equ DEOXYS_ATTACK, 0x382 @Renewal of Deoxys' index
.equ DEOXYS_DEFENSE, 0x383 @Renewal of Deoxys' index
.equ DEXOYS_SPEED, 0x384 @Renewal of Deoxys' index
.equ NOPE, 0x385 @Generation VII Pokemon starts here

.org 0x43F90, 0xFF
ldr r1, Hook3
bx r1
.align 2
Hook3: .word RomAreaOffset+dex_seeable_mon_hook+1

.org 0x88EDC, 0xFF
ldr r1, Hook6
bx r1
.align 2
Hook6: .word RomAreaOffset+dex_regional_count_hook+1

.org 0xCE91A, 0xFF
ldr r1, Hook4
bx r1
.align 2
Hook4: .word RomAreaOffset+dex_evolution_fix_hook+1

.org 0x10352C, 0xFF
ldr r1, Hook7
bx r1
.align 2
Hook7: .word RomAreaOffset+dex_display_hook+1

.org 0x10356C, 0xFF
ldr r0, Hook8
bx r0
.align 2
Hook8: .word RomAreaOffset+regional_dex_hook+1

.org 0x1035B4, 0xFF
ldr r1, Hook9
bx r1
.align 2
Hook9: .word RomAreaOffset+store_last_dex_seen_hook+1

.org 0x1035F4, 0xFF
ldr r0, HookA
bx r0
.align 2
HookA: .word RomAreaOffset+lazy_regional_dex_end_hook+1

.org 0x104A66, 0xFF
ldr r1, HookB
bx r1
.align 2
HookB: .word RomAreaOffset+display_regional_num_hook+1

.org 0x104BBC, 0xFF
ldr r2, Hook5
bx r2
.align 2
Hook5: .word RomAreaOffset+dex_display_counts_hook+1

.org 0x106810, 0xFF
ldr r1, Hook2
bx r1
.align 2
Hook2: .word RomAreaOffset+habitat_dex_regional_limit_hook+1

.org 0x106B84, 0xFF
ldr r1, Hook1
bx r1
.align 2
Hook1: .word RomAreaOffset+data_on_capture_hook+1

.org MyLoc, 0xFF
data_on_capture_hook:	@0x08106B84 via r1
	bl species_to_regional_dex_number
	cmp r0, #0x0
	bne capture_display_return
	ldr r0, add_task_no_capture_display
	bx r0

capture_display_return:
	ldr r0, add_task_capture_display
	bx r0


.align 2
.pool

.align 2


habitat_dex_regional_limit_hook:	@0x08106810 via r1
	push {r4, lr}
	mov r4, r0
	bl haz_national_dex_bool
	cmp r0, #0x1
	beq habitat_dex_regional_limit_return	@valid
	mov r0, r4
	bl species_to_regional_dex_number
	cmp r0, #0x0
	beq habitat_dex_regional_limit_return	@not in regional dex, return 0
	mov r0, #0x1

habitat_dex_regional_limit_return:
	pop {r4}
	pop {r1}
	bx r1


.align 2
.pool

.align 2


dex_seeable_mon_hook:	@0x08043F90 via r1
	push {r4, lr}
	mov r4, r0
	bl haz_national_dex_bool
	cmp r0, #0x0
	beq only_regional_numbered
@national
	mov r0, r4
	bl species_to_national_dex_number_1
	b dex_seeable_mon_check_valid_species

only_regional_numbered:
	mov r0, r4
	bl species_to_regional_dex_number

dex_seeable_mon_check_valid_species:
	cmp r0, #0x0
	bne dex_seeable_mon_return
	ldr r0, full_halfword

dex_seeable_mon_return:
	pop {r4}
	pop {r1}
	bx r1
.align
full_halfword:	.word 0xFFFF


.align 2
.pool

.align 2


dex_evolution_fix_hook:	@0x080CE91A via r1
	bl species_to_regional_dex_number
	cmp r0, #0x0	@not in regional dex, invalid
	beq dex_evolution_failure
	ldr r0, dex_evolution_success_return
	bx r0

dex_evolution_failure:
	mov r0, #0x11
	strh r0, [r5, #0x8]
	mov r2, #0x1
	ldr r1, dex_evolution_failure_return
	bx r1


.align 2
.pool

.align 2


dex_display_counts_hook:	@0x08104BBC via r2
	@r0: mode
	push {lr}
	cmp r1, #0x0
	beq call_regional_count
	bl national_pokedex_count
	b dex_display_counts_return

call_regional_count:
	bl dex_regional_count_hook

dex_display_counts_return:
	pop {pc}


.align 2
.pool

.align 2


dex_regional_count_hook:	@0x08088EDC via r1
	push {r4-r6, lr}
	mov r6, r0	@mode
	mov r4, #0x1	@loop
	mov r5, #0x0	@counter

dex_regional_count_loop:
	lsl r0, r4, #0x1	@loop times 2
	adr r1, regional_dex_order
	ldrh r0, [r1, r0]	@req species
	mov r1, r6	@mode
	mov r2, #0x1	@input is SPECIES
	bl dex_flag_check
	add r5, r5, r0
	add r4, #0x1
	ldr r0, regional_dex_limit
	cmp r4, r0
	blo dex_regional_count_loop
	mov r0, r5
	pop {r4-r6, pc}


.align 2
.pool

.align 2


dex_display_hook:	@0x0810352C via r1
	ldr r1, regional_dex_limit
	cmp r0, #0x0
	beq store_dex_limit_and_return
	ldr r1, national_dex_limit

store_dex_limit_and_return:
	str r1, [sp, #0x0]
	ldr r0, regional_dex_limit_return
	bx r0


.align 2
.pool

.align 2


regional_dex_hook:	@0x0810356C via r0
	mov r4, r8
	add r4, #0x1
	lsl r0, r4, #0x1	@index times 2
	adr r1, regional_dex_order
	ldrh r0, [r1, r0]
	bl species_to_national_dex_number_1
	mov r5, r0
	mov r1, #0x0
	ldr r2, regional_dex_hook_return
	bx r2


.align 2
.pool

.align 2


store_last_dex_seen_hook:	@0x081035B4 via r1
	str r0, [r2]
	mov r10, r4
	mov r4, r3
	ldr r0, def_store_string_dex_number
	bx r0


.align 2
.pool

.align 2


lazy_regional_dex_end_hook:	@0x081035F4 via r0
	mov r0, r8
	ldr r1, regional_dex_limit
	cmp r0, r1
	blo regional_dex_hook
	ldr r0, end_dex_display_return
	bx r0


.align 2
.pool

.align 2


display_regional_num_hook:	@0x08104A66 via r1
	mov r5, r0	@save species
	bl haz_national_dex_bool
	cmp r0, #0x0
	beq use_regional_dex_ordering
	ldr r1, dex_malloc_ptr
	ldr r1, [r1]
	add r1, #0x42
	ldrb r1, [r1]
	cmp r1, #0x0	@check if looking at regional dex
	beq use_regional_dex_ordering
	mov r0, r5
	bl species_to_national_dex_number_1
	b display_dex_number_return

use_regional_dex_ordering:
	mov r0, r5
	bl species_to_regional_dex_number	

display_dex_number_return:
	mov r5, r0
	ldr r0, dex_number_display_return
	bx r0





species_to_regional_dex_number:
	adr r3, regional_dex_order
	mov r2, r0	@req species
	mov r0, #0x0	@loop counter
find_regional_number_loop:
	lsl r1, r0, #0x1
	ldrh r1, [r3, r1]
	cmp r1, r2
	beq species_to_regional_dex_return
	add r0, #0x1
	ldr r1, regional_dex_limit
	cmp r0, r1
	bls find_regional_number_loop
	mov r0, #0x0	@not in dex: set number to 0
species_to_regional_dex_return:
	bx lr



species_to_national_dex_number_1:
	ldr r1, f_species_to_nat_dex
	bx r1
.align
f_species_to_nat_dex:	.word 0x08043298 + 1

haz_national_dex_bool:
	ldr r0, f_haz_national_check
	bx r0
.align
f_haz_national_check:	.word 0x0806E25C + 1

dex_flag_check:
	ldr r3, f_dex_flag_check
	bx r3
.align
f_dex_flag_check:	.word 0x08104AB0 + 1

national_pokedex_count:
	ldr r1, f_national_pokedex_count
	bx r1
.align
f_national_pokedex_count:	.word 0x08088E8C + 1



.align
add_task_no_capture_display:	.word 0x08106B90 + 1
add_task_capture_display:	.word 0x08106BA4 + 1
dex_evolution_success_return:	.word 0x080CE948 + 1
dex_evolution_failure_return:	.word 0x080CE924 + 1
regional_dex_limit:	.word number_of_mons_in_regional_dex
national_dex_limit:	.word number_of_mons_in_national_dex
regional_dex_limit_return:	.word 0x0810353a + 1
regional_dex_hook_return:	.word 0x08103578 + 1
def_store_string_dex_number:	.word 0x081035D6 + 1
end_dex_display_return:	.word 0x08103906 + 1
dex_malloc_ptr:			.word 0x0203ACF0
dex_number_display_return:	.word 0x08104A70 + 1

regional_dex_order:
.hword	0x0000
.hword	TREECKO
.hword	GROVYLE
.hword	SCEPTILE
.hword	TORCHIC
.hword	COMBUSKEN
.hword	BLAZIKEN
.hword	MUDKIP
.hword	MARSHTOMP
.hword	SWAMPERT
.hword	POOCHYENA
.hword	MIGHTYENA
.hword	ZIGZAGOON
.hword	LINOONE
.hword	WURMPLE
.hword	SILCOON
.hword	BEAUTIFLY
.hword	CASCOON
.hword	DUSTOX
.hword	LOTAD
.hword	LOMBRE
.hword	LUDICOLO
.hword	SEEDOT
.hword	NUZLEAF
.hword	SHIFTRY
.hword	TAILLOW
.hword	SWELLOW
.hword	WINGULL
.hword	PELIPPER
.hword	RALTS
.hword	KIRLIA
.hword	GARDEVOIR
.hword	SURSKIT
.hword	MASQUERAIN
.hword	SHROOMISH
.hword	BRELOOM
.hword	SLAKOTH
.hword	VIGOROTH
.hword	SLAKING
.hword	ABRA
.hword	KADABRA
.hword	ALAKAZAM
.hword	NINCADA
.hword	NINJASK
.hword	SHEDINJA
.hword	WHISMUR
.hword	LOUDRED
.hword	EXPLOUD
.hword	MAKUHITA
.hword	HARIYAMA
.hword	GOLDEEN
.hword	SEAKING
.hword	MAGIKARP
.hword	GYARADOS
.hword	AZURILL
.hword	MARILL
.hword	AZUMARILL
.hword	GEODUDE
.hword	GRAVELER
.hword	GOLEM
.hword	NOSEPASS
.hword	SKITTY
.hword	DELCATTY
.hword	ZUBAT
.hword	GOLBAT
.hword	CROBAT
.hword	TENTACOOL
.hword	TENTACRUEL
.hword	SABLEYE
.hword	MAWILE
.hword	ARON
.hword	LAIRON
.hword	AGGRON
.hword	MACHOP
.hword	MACHOKE
.hword	MACHAMP
.hword	MEDITITE
.hword	MEDICHAM
.hword	ELECTRIKE
.hword	MANECTRIC
.hword	PLUSLE
.hword	MINUN
.hword	MAGNEMITE
.hword	MAGNETON
.hword	VOLTORB
.hword	ELECTRODE
.hword	VOLBEAT
.hword	ILLUMISE
.hword	ODDISH
.hword	GLOOM
.hword	VILEPLUME
.hword	BELLOSSOM
.hword	DODUO
.hword	DODRIO
.hword	ROSELIA
.hword	GULPIN
.hword	SWALOT
.hword	CARVANHA
.hword	SHARPEDO
.hword	WAILMER
.hword	WAILORD
.hword	NUMEL
.hword	CAMERUPT
.hword	SLUGMA
.hword	MAGCARGO
.hword	TORKOAL
.hword	GRIMER
.hword	MUK
.hword	KOFFING
.hword	WEEZING
.hword	SPOINK
.hword	GRUMPIG
.hword	SANDSHREW
.hword	SANDSLASH
.hword	SPINDA
.hword	SKARMORY
.hword	TRAPINCH
.hword	VIBRAVA
.hword	FLYGON
.hword	CACNEA
.hword	CACTURNE
.hword	SWABLU
.hword	ALTARIA
.hword	ZANGOOSE
.hword	SEVIPER
.hword	LUNATONE
.hword	SOLROCK
.hword	BARBOACH
.hword	WHISCASH
.hword	CORPHISH
.hword	CRAWDAUNT
.hword	BALTOY
.hword	CLAYDOL
.hword	LILEEP
.hword	CRADILY
.hword	ANORITH
.hword	ARMALDO
.hword	IGGLYBUFF
.hword	JIGGLYPUFF
.hword	WIGGLYTUFF
.hword	FEEBAS
.hword	MILOTIC
.hword	CASTFORM
.hword	STARYU
.hword	STARMIE
.hword	KECLEON
.hword	SHUPPET
.hword	BANETTE
.hword	DUSKULL
.hword	DUSCLOPS
.hword	TROPIUS
.hword	CHIMECHO
.hword	ABSOL
.hword	VULPIX
.hword	NINETALES
.hword	PICHU
.hword	PIKACHU
.hword	RAICHU
.hword	PSYDUCK
.hword	GOLDUCK
.hword	WYNAUT
.hword	WOBBUFFET
.hword	NATU
.hword	XATU
.hword	GIRAFARIG
.hword	PHANPY
.hword	DONPHAN
.hword	PINSIR
.hword	HERACROSS
.hword	RHYHORN
.hword	RHYDON
.hword	SNORUNT
.hword	GLALIE
.hword	SPHEAL
.hword	SEALEO
.hword	WALREIN
.hword	CLAMPERL
.hword	HUNTAIL
.hword	GOREBYSS
.hword	RELICANTH
.hword	CORSOLA
.hword	CHINCHOU
.hword	LANTURN
.hword	LUVDISC
.hword	HORSEA
.hword	SEADRA
.hword	KINGDRA
.hword	BAGON
.hword	SHELGON
.hword	SALAMENCE
.hword	BELDUM
.hword	METANG
.hword	METAGROSS
.hword	REGIROCK
.hword	REGICE
.hword	REGISTEEL
.hword	LATIAS
.hword	LATIOS
.hword	KYOGRE
.hword	GROUDON
.hword	RAYQUAZA
.hword	JIRACHI
.hword	DEOXYS
So I have an addendum to this that allows for Pokémon in the custom regional dex to be seen in the Pokédex Search Modes.

It's a bit hacky, as it technically allows every Pokémon in the National Dex to be seen, so they'll be listed as No. 000 if using the the quoted custom regional dex routine. What it does is hijack the routine for loading each Pokédex Search Mode to increase the limit of the regional dex to 386 Pokémon like the National Dex mode routine does.

If anyone can improve it so that it allows for only custom regional dex Pokémon before getting the National Dex, please do so. My knowledge of ASM hacking is pretty limited, so this is the best I can do for now.

Code:
.thumb
.align

.equ number_of_mons_in_regional_dex, 170 @or however long you wanted your regional dex to be
.equ number_of_mons_in_national_dex, 386
.equ MyLoc, 0x7202E0 @insert your location here
.equ RomAreaOffset,	0x8000000

.org 0x103616, 0xFF
ldr r1, HookAlphabet
bx r1
.align 2
HookAlphabet: .word RomAreaOffset+insert_386_hook_alphabet+1

.org 0x1036B6, 0xFF
ldr r1, HookType
bx r1
.align 2
HookType: .word RomAreaOffset+insert_386_hook_type+1

.org 0x10374E, 0xFF
ldr r1, HookWeight
bx r1
.align 2
HookWeight: .word RomAreaOffset+insert_386_hook_weight+1

.org 0x1037EA, 0xFF
ldr r1, HookHeight
bx r1
.align 2
HookHeight: .word RomAreaOffset+insert_386_hook_height+1

.org MyLoc, 0xFF
insert_386_hook_alphabet: @0x103616 via r1
ldr           r0, national_dex_limit
cmp        r5, r0
bgt          branch_to_finish_loop_alphabet
movs	r0, r5
movs	r1, #0
ldr		r2, alphabet_hook_return
bx		r2

branch_to_finish_loop_alphabet:
ldr 		r2, check_finish_loop_alphabet
bx		r2


.align 2
.pool

.align 2

insert_386_hook_type: @0x1036B6 via r1
ldr           r0, national_dex_limit
cmp        r5, r0
bgt          branch_to_finish_loop_type
movs      r0, r5
movs      r1, #0
ldr		r0, type_hook_return
bx		r0

branch_to_finish_loop_type:
ldr 		r2, check_finish_loop_type
bx		r2


.align 2
.pool

.align 2

insert_386_hook_weight: @0x10374E via r1
ldr           r0, national_dex_limit
cmp        r5, r0
bgt          branch_to_finish_loop_weight
movs	r0, r5
movs	r1, #0
ldr		r0, weight_hook_return
bx		r0

branch_to_finish_loop_weight:
ldr 		r2, check_finish_loop_weight
bx		r2

.align 2
.pool

.align 2

insert_386_hook_height: @0x1037EA via r1
ldr           r0, national_dex_limit
cmp        r5, r0
bgt          branch_to_finish_loop_height
movs	r0, r5
movs	r1, #0
ldr		r0, height_hook_return
bx			   r0

branch_to_finish_loop_height:
ldr 		   r2, check_finish_loop_height
bx			   r2


.align 2
.pool

.align 2


national_dex_limit:	.word number_of_mons_in_national_dex
check_finish_loop_alphabet:	.word 0x8103682 + 1
alphabet_hook_return:	.word 0x8103620 + 1
check_finish_loop_type:	.word 0x8103722 + 1
type_hook_return:	.word 0x81036C0 + 1
check_finish_loop_weight:	.word 0x81037BA + 1
weight_hook_return:	.word 0x8103758 + 1
check_finish_loop_height:	.word 0x8103856 + 1
height_hook_return:	.word 0x81037F4 + 1
Reply With Quote
  #1364   Link to this post, but load the entire thread.  
Old June 22nd, 2018 (2:58 PM). Edited June 24th, 2018 by Lunos.
Lunos's Avatar
Lunos Lunos is offline
Random Uruguayan User
 
Join Date: Oct 2008
Location: Montevideo (Uruguay)
Gender: Male
Nature: Lonely
Posts: 3,000
Quote:
Originally Posted by FBI View Post
Quote:
Originally Posted by Touched
HEX EDIT

0x12EB54: 45 66 05 08
0x054A68: 3C 4C
0x054A6A: 20 68
0x054A6C: 00 49
0x054A6E: 01 E0
0x054A7E: 34 4E
0x054B3A: 00 00
0x054B3C: 00 00
0x054A70: REVERSED POINTER TO TEXT CONTAINING YOUR DEFAULT NAME (max 8 chars, last char must be 0)
EDIT: Despite what he says about last char having to be zero, I think its a typo for FF. The name's size limit is 7 bytes (chars) the last byte must be 0xFF (string terminator). If the name is less than 7 characters, pad the remaining characters with 0xFF.
Is there a way to set a pre-defined name for the Rival too though?
Because without something like that, this is what happens In-Game.


Unrelated: Could someone port this routine to Emerald, please?
It's basically FBI's EV/IV Checker, but it uses the Vars 8000-8005 instead of 8005-800A.
He wrote it in a matter of minutes at some point inside the Discord server and I had it saved ever since, but I'd really like to have a version that works with Pokémon Emerald too.
Thanks :)
__________________
Reply With Quote
  #1365   Link to this post, but load the entire thread.  
Old June 23rd, 2018 (10:24 PM).
tkim's Avatar
tkim tkim is offline
 
Join Date: May 2011
Posts: 232
Quote:
Originally Posted by Spherical Ice View Post

Nature-affected stats colouring routines [FR]:


CLICK FOR EMERALD

Spoiler:
This is probably the least efficient way to do this, but it works.

Attack:
Code:
.thumb
@ 00 49 08 47 XX XX XX XX at x137134

ldr r1, [r2]
ldrb r2,[r1,#4]
add r2,#0x32
lsl r2,r2,#0x18
lsr r2,r2,#0x18
push {r0-r3}
ldr r0, =(0x0203B140)
ldr r0, [r0]
ldr r2, =(0x3290)
add r0, r0, r2
mov r1, #0
bl decryptbranch
bl getnaturebranch
cmp r0, #1 @ Lonely
beq red
cmp r0, #2 @ Brave
beq red
cmp r0, #3 @ Adamant
beq red
cmp r0, #4 @ Naughty
beq red
cmp r0, #5 @ Bold
beq blue
cmp r0, #10 @ Timid
beq blue
cmp r0, #15 @ Modest
beq blue
cmp r0, #20 @ Calm
beq blue

black:
ldr r6, blackfont
b end

red:
ldr r6, redfont
b end

blue:
ldr r6, bluefont

end:
pop {r0-r3}
ldr r1, =(0x0813713c+1)
bx r1

decryptbranch:
ldr r2, =(0x0803FBE8+1)
bx r2

getnaturebranch:
ldr r2, =(0x08042EB4+1)
bx r2

.align 2
blackfont: .word 0x08463FA4 @ In a vanilla FR ROM, this contains: 00 0E 0A 00
redfont: .word 0x08RRRRRR @ ROM location that contains: 00 01 0A 00
bluefont: .word 0x08BBBBBB @ ROM location that contains: 00 07 0A 00
Defense:
Code:
.thumb
@ 00 49 08 47 XX XX XX XX at x137158

ldr r1, [r2]
ldrb r2,[r1,#6]
add r2,#0x32
lsl r2,r2,#0x18
lsr r2,r2,#0x18
push {r0-r3}
ldr r0, =(0x0203B140)
ldr r0, [r0]
ldr r2, =(0x3290)
add r0, r0, r2
mov r1, #0
bl decryptbranch
bl getnaturebranch
cmp r0, #1 @ Lonely
beq blue
cmp r0, #5 @ Nold
beq red
cmp r0, #7 @ Relaxed
beq red
cmp r0, #8 @ Impish
beq red
cmp r0, #9 @ Lax
beq red
cmp r0, #11 @ Hasty
beq blue
cmp r0, #16 @ Mild
beq blue
cmp r0, #21 @ Gentle
beq blue

black:
ldr r6, blackfont
b end

red:
ldr r6, redfont
b end

blue:
ldr r6, bluefont

end:
pop {r0-r3}
ldr r1, =(0x08137162+1)
bx r1

decryptbranch:
ldr r2, =(0x0803FBE8+1)
bx r2

getnaturebranch:
ldr r2, =(0x08042EB4+1)
bx r2

.align 2
blackfont: .word 0x08463FA4 @ In a vanilla FR ROM, this contains: 00 0E 0A 00
redfont: .word 0x08RRRRRR @ ROM location that contains: 00 01 0A 00
bluefont: .word 0x08BBBBBB @ ROM location that contains: 00 07 0A 00
Special Attack:
Code:
.thumb
@ 00 49 08 47 XX XX XX XX at x13717C

mov r2,r8
ldr r1, [r2]
ldrb r2,[r1,#8]
add r2,#0x32
lsl r2,r2,#0x18
lsr r2,r2,#0x18
push {r0-r3}
ldr r0, =(0x0203B140)
ldr r0, [r0]
ldr r2, =(0x3290)
add r0, r0, r2
mov r1, #0
bl decryptbranch
bl getnaturebranch
cmp r0, #3 @ Adamant
beq blue
cmp r0, #8 @ Impish
beq blue
cmp r0, #13 @ Jolly
beq blue
cmp r0, #15 @ Modest
beq red
cmp r0, #16 @ Mild
beq red
cmp r0, #17 @ Quiet
beq red
cmp r0, #19 @ Rash
beq red
cmp r0, #23 @ Careful
beq blue

black:
ldr r6, blackfont
b end

red:
ldr r6, redfont
b end

blue:
ldr r6, bluefont

end:
pop {r0-r3}
ldr r1, =(0x08137188+1)
bx r1

decryptbranch:
ldr r2, =(0x0803FBE8+1)
bx r2

getnaturebranch:
ldr r2, =(0x08042EB4+1)
bx r2

.align 2
blackfont: .word 0x08463FA4 @ In a vanilla FR ROM, this contains: 00 0E 0A 00
redfont: .word 0x08RRRRRR @ ROM location that contains: 00 01 0A 00
bluefont: .word 0x08BBBBBB @ ROM location that contains: 00 07 0A 00
Special Defense:
Code:
.thumb
@ 00 49 08 47 XX XX XX XX at x1371A4

ldr r1, [r2]
ldrb r2,[r1,#0xA]
add r2,#0x32
lsl r2,r2,#0x18
lsr r2,r2,#0x18
push {r0-r3}
ldr r0, =(0x0203B140)
ldr r0, [r0]
ldr r2, =(0x3290)
add r0, r0, r2
mov r1, #0
bl decryptbranch
bl getnaturebranch
cmp r0, #4 @ Naughty
beq blue
cmp r0, #9 @ Lax
beq blue
cmp r0, #14 @ Naive
beq blue
cmp r0, #19 @ Rash
beq blue
cmp r0, #20 @ Calm
beq red
cmp r0, #21 @ Gentle
beq red
cmp r0, #22 @ Sassy
beq red
cmp r0, #23 @ Careful
beq red

black:
ldr r6, blackfont
b end

red:
ldr r6, redfont
b end

blue:
ldr r6, bluefont

end:
pop {r0-r3}
ldr r1, =(0x081371AE+1)
bx r1

decryptbranch:
ldr r2, =(0x0803FBE8+1)
bx r2

getnaturebranch:
ldr r2, =(0x08042EB4+1)
bx r2

.align 2
blackfont: .word 0x08463FA4 @ In a vanilla FR ROM, this contains: 00 0E 0A 00
redfont: .word 0x08RRRRRR @ ROM location that contains: 00 01 0A 00
bluefont: .word 0x08BBBBBB @ ROM location that contains: 00 07 0A 00
Speed:
Code:
.thumb
@ 00 49 08 47 XX XX XX XX at x1371C8

mov r2,r8
ldr r1, [r2]
ldrb r2,[r1,#0xC]
add r2,#0x32
lsl r2,r2,#0x18
lsr r2,r2,#0x18
push {r0-r3}
ldr r0, =(0x0203B140)
ldr r0, [r0]
ldr r2, =(0x3290)
add r0, r0, r2
mov r1, #0
bl decryptbranch
bl getnaturebranch
cmp r0, #2 @ Brave
beq blue
cmp r0, #7 @ Relaxed
beq blue
cmp r0, #10 @ Timid
beq red
cmp r0, #11 @ Hasty
beq red
cmp r0, #13 @ Jolly
beq red
cmp r0, #14 @ Naive
beq red
cmp r0, #17 @ Quiet
beq blue
cmp r0, #22 @ Sassy
beq blue

black:
ldr r6, blackfont
b end

red:
ldr r6, redfont
b end

blue:
ldr r6, bluefont

end:
pop {r0-r3}
ldr r1, =(0x081371d4+1)
bx r1

decryptbranch:
ldr r2, =(0x0803FBE8+1)
bx r2

getnaturebranch:
ldr r2, =(0x08042EB4+1)
bx r2

.align 2
blackfont: .word 0x08463FA4 @ In a vanilla FR ROM, this contains: 00 0E 0A 00
redfont: .word 0x08RRRRRR @ ROM location that contains: 00 01 0A 00
bluefont: .word 0x08BBBBBB @ ROM location that contains: 00 07 0A 00
Reverting the font colour back to black:
Code:
.thumb
@ 00 49 08 47 XX XX XX XX at 081371F0

ldr r1, [r2]
ldrb r2,[r1,#0xE]
add r2,#0xF
lsl r2,r2,#0x18
lsr r2,r2,#0x18
ldr r6, blackfont
ldr r1, =(0x081371FA+1)
bx r1

.align 2
blackfont: .word 0x08463FA4 @ In a vanilla FR ROM, this contains: 00 0E 0A 00
where XX XX XX XX is the location of each routine +1.

This colours the stat increased by the Pokémon's nature red, and the stat that is decreased blue.



Edit: Updated 23/12/2015, the old routines had a few errors that I forgot to update after making changes to my ROM. I've also confirmed what bluefont should be in a vanilla ROM. Enjoy!


Hi Spherical Ice, could you shorten your routines into one, similar to what MWisBest did for DizzyEgg's? https://www.pokecommunity.com/showpost.php?p=9611218&postcount=1150
Reply With Quote
  #1366   Link to this post, but load the entire thread.  
Old June 27th, 2018 (6:03 PM). Edited June 27th, 2018 by Lunos.
Lunos's Avatar
Lunos Lunos is offline
Random Uruguayan User
 
Join Date: Oct 2008
Location: Montevideo (Uruguay)
Gender: Male
Nature: Lonely
Posts: 3,000
Quote:
Originally Posted by Skeli- View Post
Expanding the Bag Entirely [FR]
I think I'm screwing up somewhere, because I can't get this to work.
Basically, the process as you explain it Skelli is:
Quote:
1) At 0x1083F4, Ctrl+B this: 10 B5 09 4C F1 20 3C 30 C0 00 FA F6 CD FB 20 60 00 28 06 D0 05 48 FA F6 C7 FB 60 60 00 28 00 D0 01 20 10 BC 02 BC 08 47 18 AD 03 02 E3 11 00 00

2) At 0x99E44, Ctrl+B this: 10 49 0C 48 08 60 96 20 40 00 88 80 08 48 88 60 3C 20 08 73 08 48 08 61 1B 20 08 75 07 48 88 61 80 20 08 77 06 48 08 62 24 31 43 20 08 70 70 47 C0 59 02 02 D0 C6 03 02 3C 58 02 02 D0 C4 03 02 B0 58 02 02 8C 98 03 02

3) Save and test.
Correct?
Welp, I can't get more than 44 items.
This is the script that I'm trying, and all the items after Calcium are being omitted: https://pastebin.com/gK3UpwHA

EDIT: I also tried to put all the items after the Calcium in a separate script, but it's useless. I'm just not getting them.
The bag still ends at Calcium, the 44th item.
__________________
Reply With Quote
  #1367   Link to this post, but load the entire thread.  
Old June 27th, 2018 (6:26 PM). Edited June 27th, 2018 by Skeli.
Skeli's Avatar
Skeli Skeli is offline
Lord of the Rings
 
Join Date: Apr 2014
Location: Canada
Age: 24
Gender: Male
Nature: Adamant
Posts: 300
Quote:
Originally Posted by Lunos View Post
I think I'm screwing up somewhere, because I can't get this to work.
Basically, the process as you explain it Skelli is:


Correct?
Welp, I can't get more than 44 items.
This is the script that I'm trying, and all the items after Calcium are being omitted: https://pastebin.com/gK3UpwHA

EDIT: I also tried to put all the items after the Calcium in a separate script, but it's useless. I'm just not getting them.
The bag still ends at Calcium, the 44th item.
You need to use it in conjunction with this routine posted by Azurile13:
Code:
.equ largest_pocket_size, 0xF0
.equ largest_pocket_size_plus_one, largest_pocket_size + 1
.equ strings_size,	largest_pocket_size_plus_one * 19

.org 0x1083F4
main:
	push {r4, lr}
	ldr r4, =(0x0203AD18)
	mov r0, #largest_pocket_size_plus_one
	add r0, #0xA0 @Change to 0x3C for 300 items
	lsl r0, #0x3
	bl 0x2B9C @malloc
	str r0, [r4]
	cmp r0, #0x0
	beq return
	ldr r0, =strings_size
	bl 0x2B9C @malloc
	str r0, [r4, #0x4]
	cmp r0, #0x0
	beq return
	mov r0, #0x1

return:
	pop {r4,pc}
It's been modified to allow support for up to 400 items.
__________________
Pokemon Unbound

Reply With Quote
  #1368   Link to this post, but load the entire thread.  
Old June 27th, 2018 (6:33 PM). Edited June 27th, 2018 by Lunos.
Lunos's Avatar
Lunos Lunos is offline
Random Uruguayan User
 
Join Date: Oct 2008
Location: Montevideo (Uruguay)
Gender: Male
Nature: Lonely
Posts: 3,000
Quote:
Originally Posted by Skeli- View Post
You need to use it in conjunction with this routine posted by Azurile13:
Code:
.equ largest_pocket_size, 0xF0
.equ largest_pocket_size_plus_one, largest_pocket_size + 1
.equ strings_size,	largest_pocket_size_plus_one * 19

.org 0x1083F4
main:
	push {r4, lr}
	ldr r4, =(0x0203AD18)
	mov r0, #largest_pocket_size_plus_one
	add r0, #0xA0 @Change to 0x3C for 300 items
	lsl r0, #0x3
	bl 0x2B9C @malloc
	str r0, [r4]
	cmp r0, #0x0
	beq return
	ldr r0, =strings_size
	bl 0x2B9C @malloc
	str r0, [r4, #0x4]
	cmp r0, #0x0
	beq return
	mov r0, #0x1

return:
	pop {r4,pc}
It's been modified to allow support for up to 400 items.
Isn't that the very first step that I described though?
Quote:
1) At 0x1083F4, Ctrl+B this: 10 B5 09 4C F1 20 3C 30 C0 00 FA F6 CD FB 20 60 00 28 06 D0 05 48 FA F6 C7 FB 60 60 00 28 00 D0 01 20 10 BC 02 BC 08 47 18 AD 03 02 E3 11 00 00
EDIT: Wait, that routine you posted now looks different compared to the one you shared in the post that I quoted before.
I'm confused.
__________________
Reply With Quote
  #1369   Link to this post, but load the entire thread.  
Old June 27th, 2018 (6:37 PM).
Skeli's Avatar
Skeli Skeli is offline
Lord of the Rings
 
Join Date: Apr 2014
Location: Canada
Age: 24
Gender: Male
Nature: Adamant
Posts: 300
Quote:
Originally Posted by Lunos View Post
Isn't that the very first step that I described though?
I made a mistake in that post. Assemble the new routine, goto the offset in the routine, and copy what’s there in the .bin file to that offset in your rom.
__________________
Pokemon Unbound

Reply With Quote
  #1370   Link to this post, but load the entire thread.  
Old June 27th, 2018 (6:46 PM). Edited June 27th, 2018 by Lunos.
Lunos's Avatar
Lunos Lunos is offline
Random Uruguayan User
 
Join Date: Oct 2008
Location: Montevideo (Uruguay)
Gender: Male
Nature: Lonely
Posts: 3,000
Quote:
Originally Posted by Skeli- View Post
I made a mistake in that post. Assemble the new routine, goto the offset in the routine, and copy what’s there in the .bin file to that offset in your rom.
So, what I have to put in 0x1083F4 now is basically:
10 B5 08 4C F1 20 A0 30 C0 00 FA F6 CD FB 20 60 00 28 06 D0 04 48 FA F6 C7 FB 60 60 00 28 00 D0 01 20 10 BD 18 AD 03 02 E3 11 00 00
^ That is the routine that you just gave to me right here.

Then I go to 0x99E44 and Ctrl+B this:
10 49 0C 48 08 60 96 20 40 00 88 80 08 48 88 60 3C 20 08 73 08 48 08 61 1B 20 08 75 07 48 88 61 80 20 08 77 06 48 08 62 24 31 43 20 08 70 70 47 C0 59 02 02 D0 C6 03 02 3C 58 02 02 D0 C4 03 02 B0 58 02 02 8C 98 03 02
As you explained in this post.

And then it should be working?
Because it's not. The Items pocket of my bag is still capping at 44 items.


EDIT: Alright, we were able to solve the issue on Discord.

The procedure is simple and I'm gonna leave it right here in order to avoid any kind of confusion:
1) Compile the routine that Skeli posted right here and Ctrl+B it in 0x1083F4.
2) Compile this ASM Routine that he wrote and Ctrl+B it in 0x99E44.
3) Save and test, but make sure to start a new savefile. Old savefiles will not work.
And that's it.

Here's a quick video showing it in action.
__________________
Reply With Quote
  #1371   Link to this post, but load the entire thread.  
Old June 28th, 2018 (4:29 PM). Edited June 28th, 2018 by UltimaSoul.
UltimaSoul UltimaSoul is offline
 
Join Date: May 2018
Posts: 53
Hey everyone. I have another ASM hack to provide.

This ASM hack is one for infinite use of the Elemental Hyper Beam tutor and I've made it so that all of the final starter evolutions have access to their respective ultimate moves just like in newer games as well. It isn't like the other tutors where you can just clear or never set a particular flag just by looking at the flags in the script and it also uses two routines to check for compatibility.

Routine 1:
Code:
.thumb
.align

.equ PKMN_VENUSAUR, 0x3
.equ PKMN_CHARIZARD, 0x6
.equ PKMN_BLASTOISE, 0x9
.equ PKMN_MEGANIUM, 0x9A
.equ PKMN_TYPHLOSION, 0x9D
.equ PKMN_FERALIGATR, 0xA0
.equ PKMN_SCEPTILE, 0x117
.equ PKMN_BLAZIKEN, 0x11A
.equ PKMN_SWAMPERT, 0x11D
.equ MyLoc, 0x720360 @insert your location here
.equ RomAreaOffset,	0x8000000


.org 0x120BF2, 0xFF
ldr r1, Hook
bx r1
.align 2
Hook: .word RomAreaOffset+move_tutor_hook+1

.org MyLoc, 0xFF
move_tutor_hook:
cmp r2, #0x10
beq fire_starter_check_hook
cmp r2, #0x10
bgt watercheck
cmp r2, #0xF
beq grass_starter_check_hook
ldr r1, GeneralMoveTutorCheck
bx r1


.align 2
.pool

.align 2

watercheck:
cmp r2, #0x11
beq water_starter_check_hook
ldr r1, GeneralMoveTutorCheck
bx r1


.align 2
.pool

.align 2

grass_starter_check_hook:
cmp r0, #PKMN_VENUSAUR
beq successlink
cmp r0, #PKMN_MEGANIUM
beq successlink
ldr r1, =PKMN_SCEPTILE
cmp r0, r1
beq successlink
b faillink


.align 2
.pool

.align 2

fire_starter_check_hook:
cmp r0, #PKMN_CHARIZARD
beq successlink
cmp r0, #PKMN_TYPHLOSION
beq successlink
ldr r1, =PKMN_BLAZIKEN
cmp r0, r1
beq successlink
b faillink


.align 2
.pool

.align 2

water_starter_check_hook:
cmp r0, #PKMN_BLASTOISE
beq successlink
cmp r0, #PKMN_FERALIGATR
beq successlink
ldr r1, =PKMN_SWAMPERT
cmp r0, r1
beq successlink
b faillink


.align 2
.pool

.align 2

successlink:
ldr r0, success
bx r0


.align 2
.pool

.align 2

faillink:
ldr r0, fail
bx r0


.align 2
.pool

.align 2

success: .word 0x8120C34 + 1
fail: .word 0x8120C2A + 1
GeneralMoveTutorCheck: .word 0x8120C18 + 1
Routine 1 is for hooking the compatibility check when teaching the move in the party screen.

Routine 2:
Code:
.thumb
.align

.equ PKMN_VENUSAUR, 0
.equ PKMN_CHARIZARD, 2
.equ PKMN_BLASTOISE, 4
.equ PKMN_MEGANIUM, 6
.equ PKMN_TYPHLOSION, 8
.equ PKMN_FERALIGATR, 10
.equ PKMN_SCEPTILE, 12
.equ PKMN_BLAZIKEN, 14
.equ PKMN_SWAMPERT, 16
.equ MyLoc, 0x7203C8 @insert your location here
.equ RomAreaOffset,	0x8000000
.equ move_names, 0x8901800 @change if using a repointed move name table
						   @by default this is for MrDollSteak's rombase

.org 0x0CCBC8, 0xFF
add r0, r4, #2

.org 0x0CCBCE, 0xFF
cmp r4, #16

.org 0x0CCBE2, 0xFF
ldrh r1, [r1]

.org 0x0CCBEA, 0xFF
cmp r4, #18

.org 0x0CCC00, 0xFF
ldr r1, Hook
bx r1
.align 2
Hook: .word RomAreaOffset+get_right_move_hook+1

.org 0x0CCC1C, 0xFF
.long RomAreaOffset+Table

.org 0x0CCC28, 0xFF       @comment out if using vanilla move table
.long move_names+0x112A   @comment out if using vanilla move table

.org 0x0CCC50, 0xFF		  @comment out if using vanilla move table
.long move_names+0xF97	  @comment out if using vanilla move table

.org 0x0CCC84, 0xFF		  @comment out if using vanilla move table
.long move_names+0xFA4	  @comment out if using vanilla move table

.org MyLoc, 0xFF
get_right_move_hook:
cmp r0, #0xFF
bne exit_loop_linker
cmp r7, #PKMN_VENUSAUR
beq frenzy_plant
cmp r7, #PKMN_CHARIZARD
beq blast_burn
cmp r7, #PKMN_BLASTOISE
beq hydro_cannon
cmp r7, #PKMN_MEGANIUM
beq frenzy_plant
cmp r7, #PKMN_TYPHLOSION
beq blast_burn
cmp r7, #PKMN_FERALIGATR
beq hydro_cannon
cmp r7, #PKMN_SCEPTILE
beq frenzy_plant
cmp r7, #PKMN_BLAZIKEN
beq blast_burn
cmp r7, #PKMN_SWAMPERT
beq hydro_cannon
b exit_loop_linker

.align 2
.pool

.align 2

frenzy_plant:
ldr r0, frenzy_plant_buffer
bx r0

.align 2
.pool

.align 2

blast_burn:
ldr r0, blast_burn_buffer
bx r0

.align 2
.pool

.align 2

hydro_cannon:
ldr r0, hydro_cannon_buffer
bx r0

.align 2
.pool

.align 2

exit_loop_linker:
ldr r0, exit_loop
bx r0

.align 2
.pool

.align 2

frenzy_plant_buffer: .word 0x80CCC08 + 1
blast_burn_buffer: .word 0x80CCC38 + 1
hydro_cannon_buffer: .word 0x80CCC5C + 1
exit_loop: .word 0x80CCC7A + 1

.org MyLoc + 0x4C
Table:
VENUSAUR: .hword 0x3
CHARIZARD: .hword 0x6
BLASTOISE: .hword 0x9
MEGANIUM: .hword 0x9A
TYPHLOSION: .hword 0x9D
FERALIGATR: .hword 0xA0
SCEPTILE: .hword 0x117
BLAZIKEN: .hword 0x11A
SWAMPERT: .hword 0x11D
Routine 2 is for hooking the routine run when special2 0x800D/LASTRESULT 0x1A3 is called. This checks the Pokémon in the first party for being eligible by species and having max happiness. Then it sets the appropriate move to be taught into the [buffer2] which is then used in the dialogue when the tutor recognizes that your Pokémon can be taught.

And this is the edited script for the old lady tutor:
Code:
//---------------
#org 0x1C4DEC
special 0x187
compare LASTRESULT 0x2
if 0x1 goto 0x81A7AE0
special 0x188
lock
faceplayer
clearflag 0x2DE
clearflag 0x2DF
clearflag 0x2E0
bufferfirstpokemon 0x0
msgbox 0x81A46C6 MSG_KEEPOPEN //"I perfected the ultimate move of\n..."
special2 LASTRESULT 0x1A3
compare LASTRESULT 0x0
if 0x1 goto 0x81C4F26
copyvar 0x8009 0x8005
compare PLAYERFACING 0x2
if 0x1 call 0x81C4EF0
compare PLAYERFACING 0x1
if 0x1 call 0x81C4EFB
compare PLAYERFACING 0x4
if 0x1 call 0x81C4F06
compare PLAYERFACING 0x3
if 0x1 call 0x81C4F11
msgbox 0x81A4751 MSG_YESNO //"Oh! This is the one!\nThis is the ..."
compare LASTRESULT 0x0
if 0x1 goto 0x81C4F1C
call 0x81C4F37
compare LASTRESULT 0x0
if 0x1 goto 0x81C4F1C
msgbox 0x81A4814 MSG_KEEPOPEN //"You will allow it?\pThen, let me c..."
closeonkeypress
fadescreen 0x1
goto 0x81C4EDA

//---------------
#org 0x1A7AE0
release
end

//---------------
#org 0x1C4F26
msgbox 0x81A4737 MSG_KEEPOPEN //"[.]No[.]\nI was just mistaken."
release
end

//---------------
#org 0x1C4EF0
applymovement 0x1 0x81C4F4C
waitmovement 0x0
return

//---------------
#org 0x1C4EFB
applymovement 0x1 0x81C4F4E
waitmovement 0x0
return

//---------------
#org 0x1C4F06
applymovement 0x1 0x81C4F50
waitmovement 0x0
return

//---------------
#org 0x1C4F11
applymovement 0x1 0x81C4F52
waitmovement 0x0
return

//---------------
#org 0x1C4F1C
msgbox 0x81A47E5 MSG_KEEPOPEN //"Gaah! You reject it?\nNo, I won't ..."
release
end

//---------------
#org 0x1C4F37
textcolor 0x3
special 0x171
signmsg
msgbox 0x81A644F MSG_YESNO //"Do you want to teach this move to\..."
normalmsg
call 0x81A6675
return

//---------------
#org 0x1C4EDA
call 0x81C4F30
compare LASTRESULT 0x0
if 0x1 goto 0x81C4F1C
goto 0x81C4EAB

//---------------
#org 0x1A6675
copyvar 0x8012 0x8013
return

//---------------
#org 0x1C4F30
special 0x18D
waitstate
lock
faceplayer
return

//---------------
#org 0x1C4EAB
copyvar 0x8005 0x8009
special2 LASTRESULT 0x1A4
compare LASTRESULT 0x1
if 0x1 goto 0x81C4ECD
msgbox 0x81A4865 MSG_KEEPOPEN //"Gasp, gasp, gasp[.]\pI didn't thin..."
release
end

//---------------
#org 0x1C4ECD
msgbox 0x81A48F3 MSG_KEEPOPEN //"Gasp, gasp, gasp[.]\pI have no reg..."
setflag 0x2E1
release
end


//---------
// Strings
//---------
#org 0x1A46C6
= I perfected the ultimate move of\nits type[.]\pBut will no one take it for\nfuture use?\p[.]Hm? Hmmm!\pY-you[.]\nTh-that [buffer1][.]

#org 0x1A4751
= Oh! This is the one!\nThis is the Pokémon!\pThis [buffer1] is worthy of\nlearning my ultimate move!\pWill you allow it?\pWill you allow your [buffer1] to\nlearn my [buffer2]?

#org 0x1A4814
= You will allow it?\pThen, let me confer my ultimate\n[buffer2] on your [buffer1].\pGgggrah-awooo!

#org 0x1A4737
= [.]No[.]\nI was just mistaken.

#org 0x1A47E5
= Gaah! You reject it?\nNo, I won't be dissuaded!

#org 0x1A644F
= Do you want to teach this move to\nyour Pokémon?

#org 0x1A4865
= Gasp, gasp, gasp[.]\pI didn't think I could teach that\nmove while I still lived[.]

#org 0x1A48F3
= Gasp, gasp, gasp[.]\pI have no regrets now.\nI've passed on everything I know.\pNow I can live out my life knowing\nmy work is done.


//-----------
// Movements
//-----------
#org 0x1C4F4C
#raw 0x52 //Jump in Place (Facing Down)
#raw 0xFE //End of Movements

#org 0x1C4F4E
#raw 0x53 //Jump in Place (Facing Up)
#raw 0xFE //End of Movements

#org 0x1C4F50
#raw 0x54 //Jump in Place (Facing Left)
#raw 0xFE //End of Movements

#org 0x1C4F52
#raw 0x55 //Jump in Place (Facing Right)
#raw 0xFE //End of Movements
This can be copy-pasted directly into the same location as the old script and it won't overwrite extra data.

Do note the #org 0x1A644F = Do you want to teach this move to\nyour Pokémon? is actually used by other move tutors as well. It replaces the message that tells you it can only be taught once, which doesn't make sense if you've made the tutors infinite use.

You can also change the move table name offset if you are using a custom one, but if you're just using the normal one then comment out the identified routines before compiling.

Also this clears the flags at 0x2DE, 0x2DF, and 0x2E0 which are set by special2 0x800D/LASTRESULT 0x1A4 after teaching each of the moves once allowing for infinite tutoring! This also doesn't set flag 0x2 which prevented you from teaching another move unless you exited the house and came back in again.

If there are any problems, questions, or improvements don't hesitate to reply to this message or PM me.
Reply With Quote
  #1372   Link to this post, but load the entire thread.  
Old July 5th, 2018 (5:16 PM).
BluRose BluRose is offline
blu rass
 
Join Date: Apr 2014
Location: michigan tech
Age: 22
Gender: Male
Nature: Timid
Posts: 812
Quote:
Originally Posted by Lunos View Post
Unrelated: Could someone port this routine to Emerald, please?
It's basically FBI's EV/IV Checker, but it uses the Vars 8000-8005 instead of 8005-800A.
He wrote it in a matter of minutes at some point inside the Discord server and I had it saved ever since, but I'd really like to have a version that works with Pokémon Emerald too.
Thanks :)
sorry for getting this to you late, mate
i just needed to sit down and do it

Spoiler:
Code:
.thumb
.align 2
 
main:
    push {r4-r7, lr}
    ldr r5, =(0x20375D8)
    mov r7, r5
    mov r6, r5
    add r5, r5, #0x8
    ldrb r6, [r6]
    mov r0, #0xD
    mul r6, r6, r0 @type * 0xD
    add r6, r6, #0x1A
    ldrb r5, [r5]
    mov r0, #0x64
    mul r5, r5, r0
    ldr r0, =(0x20244EC)
    add r5, r5, r0 @slot address
    mov r4, #0x0
   
loop:
    cmp r4, #0x6
    bge end    
    mov r0, r5
    mov r1, r6
    add r1, r1, r4
    mov r2, SP  
    ldr r3, =(0x0806A519)
    bl link_r3
    strh r0, [r7]
    add r4, r4, #0x1
    add r7, r7, #0x2
    b loop
   
link_r3:
    bx r3  
   
end:  
    pop {r4-r7, pc}
 
 
.align 2
__________________
heyo check out my github:

BluRosie
highlights:
battle engine for heartgold
various feature branches in heart gold (fairy type, odd egg, mud slopes)

i'm a big part of the development team of pokemon firegold! all the code that i develop for that hack is also on my github

also on discord: BluRose#0412
Reply With Quote
  #1373   Link to this post, but load the entire thread.  
Old July 5th, 2018 (6:33 PM). Edited July 5th, 2018 by Lunos.
Lunos's Avatar
Lunos Lunos is offline
Random Uruguayan User
 
Join Date: Oct 2008
Location: Montevideo (Uruguay)
Gender: Male
Nature: Lonely
Posts: 3,000
Quote:
Originally Posted by BluRose View Post
sorry for getting this to you late, mate
i just needed to sit down and do it

Spoiler:
Code:
.thumb
.align 2
 
main:
    push {r4-r7, lr}
    ldr r5, =(0x20375D8)
    mov r7, r5
    mov r6, r5
    add r5, r5, #0x8
    ldrb r6, [r6]
    mov r0, #0xD
    mul r6, r6, r0 @type * 0xD
    add r6, r6, #0x1A
    ldrb r5, [r5]
    mov r0, #0x64
    mul r5, r5, r0
    ldr r0, =(0x20244EC)
    add r5, r5, r0 @slot address
    mov r4, #0x0
   
loop:
    cmp r4, #0x6
    bge end    
    mov r0, r5
    mov r1, r6
    add r1, r1, r4
    mov r2, SP  
    ldr r3, =(0x0806A519)
    bl link_r3
    strh r0, [r7]
    add r4, r4, #0x1
    add r7, r7, #0x2
    b loop
   
link_r3:
    bx r3  
   
end:  
    pop {r4-r7, pc}
 
 
.align 2
It seems to be working beautifully, thanks Blu! <3
__________________
Reply With Quote
  #1374   Link to this post, but load the entire thread.  
Old July 9th, 2018 (6:56 AM). Edited July 9th, 2018 by tkim.
tkim's Avatar
tkim tkim is offline
 
Join Date: May 2011
Posts: 232
Quote:
Originally Posted by Spherical Ice View Post

[FR] EV-reducing Berries


Spoiler:
Find 0x49C bytes of free space at a word-aligned address, and take note of it.
Set the EV-reducing berries' Type to Type 1 ("Out of battle").
Set the items' Field script pointers to the address you noted, plus 1.
Set the items' Battle script pointer to 0xA2239.
Assemble the following routine, changing 0xXXXXXX to the address you noted (not plus 1).
Open the generated .bin file, navigate to the location address, and select 0x49C bytes.
Copy the bytes and paste them in your ROM, at the same address.

Code:
.thumb

@ -- Change these
.equ start_address, 0x29B110
@ --

.equ rom, 0x08000000

.equ pokemon_length, 0x64

.equ req_species,           0x0B
.equ req_held_item,         0x0C
.equ req_hp_ev,             0x1A
.equ req_atk_ev,            0x1B
.equ req_def_ev,            0x1C
.equ req_spe_ev,            0x1D
.equ req_spatk_ev,          0x1E
.equ req_spdef_ev,          0x1F
.equ req_happiness,         0x20
.equ req_catch_location,    0x23
.equ req_pokeball,          0x26

.equ item_luxuryball,   0x0B
.equ item_pomegberry,   0x99
.equ item_kelpsyberry,  0x9A
.equ item_qualotberry,  0x9B
.equ item_hondewberry,  0x9C
.equ item_grepaberry,   0x9D
.equ item_tomatoberry,  0x9E
.equ item_soothebell,   0xB8

.org start_address, 0xFF
ev_berries:
    push {lr}
    lsl r0, r0, #0x18
    lsr r0, r0, #0x18
    ldr r2, item_function_ptr
    ldr r1, =(rom + dp05_ev_berries + 1)
    str r1, [r2]
    ldr r3, item_consume_maybe
    bl call_via_r3
    pop {r3}

call_via_r3:
    bx r3

.align 2
    item_consume_maybe:     .word 0x080A16D0|1
    .pool

dp05_ev_berries:
    push {r4-r7,lr}
    mov r7, r10
    mov r6, r9
    mov r5, r8
    push {r5-r7}
    sub sp, sp, #0xC
    str r1, [sp, #0]
    lsl r0, r0, #0x18
    lsr r0, r0, #0x18
    mov r10, r0

get_selected_pokemon:
    ldr r4, brm
    ldrb r1, [r4, #9]
    mov r0, #pokemon_length
    mul r1, r0
    ldr r0, party_player
    add r5, r1, r0

determine_berry:
    ldr r0, var_800E
    ldrh r0, [r0]
    lsl r0, r0, #0x10
    lsr r0, r0, #0x10
    sub r0, #(item_pomegberry - 1)
    mov r7, r0

get_ev_req: 
    mov r0, r5
    mov r1, r7
    ldr r3, =(rom + get_ev_req_from_berry_id + 1)
    bl call_via_r3
    lsl r0, r0, #0x18
    lsr r0, r0, #0x18
    cmp r0, #0
    beq no_effect
    mov r6, r0

happiness_before:
    mov r0, r5
    mov r1, #req_happiness
    ldr r3, get_attr
    bl call_via_r3
    lsl r0, r0, #0x10
    lsr r0, r0, #0x10
    ldr r1, var_8000
    strh r0, [r1]

ev_value_before:
    mov r0, r5
    mov r1, r6
    mov r2, #0
    ldr r3, get_attr
    bl call_via_r3
    lsl r0, r0, #0x10
    lsr r0, r0, #0x10
    ldr r1, var_8001
    strh r0, [r1]

use_berry:
    mov r0, r5
    mov r1, r6
    ldr r3, =(rom + use_ev_berry + 1)
    bl call_via_r3
    lsl r0, r0, #0x18
    lsr r4, r0, #0x18

ev_after:
    mov r0, r5
    mov r1, r6
    mov r2, #0
    ldr r3, get_attr
    bl call_via_r3
    lsl r0, r0, #0x10
    lsr r0, r0, #0x10
    mov r8, r0

happiness_after:
    mov r0, r5
    mov r1, #req_happiness
    ldr r3, get_attr
    bl call_via_r3
    lsl r0, r0, #0x10
    lsr r0, r0, #0x10
    mov r9, r0

branch_for_effectiveness:
    cmp r4, #0
    bne no_effect
    ldr r0, var_8000
    ldrh r0, [r0]
    cmp r0, r9
    bne effect
    ldr r1, var_8001
    ldrh r1, [r1]
    cmp r1, r8
    bne effect

no_effect:
    ldr r1, item_effectiveness
    mov r0, #0
    strb r0, [r1]
    mov r0, #5
    ldr r3, audio_play
    bl call_via_r3
    ldr r0, no_effect_str
    mov r1, #1
    ldr r3, item_menu_string
    bl call_via_r3
    mov r0, #2
    ldr r3, bgid_mark_for_sync
    bl call_via_r3
    ldr r1, tasks
    mov r2, r10
    lsl r0, r2, #2
    add r0, r10
    lsl r0, r0, #3
    add r0, r0, r1
    ldr r1, [sp]
    str r1, [r0]
    b end
 
effect:
    mov r0, r10
    ldr r3, item_use_animation
    bl call_via_r3
    ldr r1, item_function_ptr
    ldr r0, =(rom + berry_use + 1)
    str r0, [r1]
  
end:
    add sp, sp, #0xC
    pop {r3-r5}
    mov r8, r3
    mov r9, r4
    mov r10, r5
    pop {r4-r7}
    pop {r0}
    bx r0

.align 2
    item_function_ptr:      .word 0x03005E98
    .pool

berry_use:
    push {r4-r7,lr}
    lsl r0, r0, #0x18
    lsr r5, r0, #0x18
    ldr r1, item_effectiveness
    mov r0, #1
    strb r0, [r1]

sound_fx:
    mov r0, #1
    ldr r3, audio_play
    bl call_via_r3

remove_item:
    ldr r0, var_800E
    ldrh r0, [r0]
    mov r1, #1
    ldr r3, bag_remove_item
    bl call_via_r3

get_selected_pokemon_again:
    ldr r4, brm
    ldrb r1, [r4, #9]
    mov r0, #pokemon_length
    mul r1, r0
    ldr r0, party_player
    add r4, r1, r0

determine_berry_again:
    ldr r0, var_800E
    ldrh r0, [r0]
    lsl r0, r0, #0x10
    lsr r0, r0, #0x10
    sub r0, #(item_pomegberry - 1)
    mov r7, r0

get_ev_req_again: 
    mov r0, r4
    mov r1, r7
    ldr r3, =(rom + get_ev_req_from_berry_id + 1)
    bl call_via_r3
    lsl r0, r0, #0x18
    lsr r1, r0, #0x18

ev_after_again:
    mov r0, r4
    mov r2, #0
    ldr r3, get_attr
    bl call_via_r3
    lsl r0, r0, #0x10
    lsr r0, r0, #0x10
    mov r8, r0

happiness_after_again:
    mov r0, r4
    mov r1, #req_happiness
    ldr r3, get_attr
    bl call_via_r3
    lsl r0, r0, #0x10
    lsr r0, r0, #0x10
    mov r9, r0

buffer_pkmn_nick_to_buffer2:
    ldr r1, fcode_buffer2
    mov r0, r4
    ldr r3, buffer_pkmn_nick
    bl call_via_r3

buffer_stat_name_to_buffer3:
    ldr r1, fcode_buffer3
    mov r0, r7
    ldr r3, =(rom + buffer_stat_name + 1)
    bl call_via_r3

branch_for_string:
    ldr r0, var_8000
    ldrh r0, [r0]
    cmp r0, r9
    beq happiness_at_max
    ldr r0, var_8001
    ldrh r0, [r0]
    cmp r0, r8
    beq ev_at_0

happiness_not_at_max_ev_above_0:
    ldr r0, displayed_string
    ldr r1, =(rom + happiness_not_at_max_ev_above_0_str)
    ldr r3, fdecoder
    bl call_via_r3
    b load_displayed_string

ev_at_0:
    ldr r0, displayed_string
    ldr r1, =(rom + happiness_up_ev_cant_fall_str)
    ldr r3, fdecoder
    bl call_via_r3
    b load_displayed_string

happiness_at_max:
    ldr r0, displayed_string
    ldr r1, =(rom + adore_ev_down_str)
    ldr r3, fdecoder
    bl call_via_r3

load_displayed_string:
    ldr r0, displayed_string

print_item_message:
    mov r1, #1
    ldr r3, item_menu_string
    bl call_via_r3
    mov r0, #2
    ldr r3, bgid_mark_for_sync
    bl call_via_r3
    ldr r1, tasks
    mov r2, r5
    lsl r0, r2, #2
    add r0, r0, r5
    lsl r0, r0, #3
    add r0, r0, r1
    ldr r1, item_menu_callback
    str r1, [r0]
    pop {r4-r7}
    pop {r0}
    bx r0

.align 2
get_ev_req_from_berry_id:
    push {r4-r7,lr}
    mov r4, r0
    lsl r1, r1, #0x18
    lsr r1, r1, #0x18
    lsl r1, r1, #2
    ldr r0, =(rom + ev_switch_table)
    add r0, r0, r1
    ldr r0, [r0]
    mov pc, r0 @ switch jump

.align 2
ev_switch_table:
    .word (rom + ev_switch_default)
    .word (rom + case_ev_hp)
    .word (rom + case_ev_atk)
    .word (rom + case_ev_def)
    .word (rom + case_ev_spatk)
    .word (rom + case_ev_spdef)
    .word (rom + case_ev_spe)

.align 2
ev_switch_default:
case_ev_hp:
    mov r0, #req_hp_ev
    b return_ev_req

case_ev_atk:
    mov r0, #req_atk_ev
    b return_ev_req

case_ev_def:
    mov r0, #req_def_ev
    b return_ev_req

case_ev_spe:
    mov r0, #req_spe_ev
    b return_ev_req

case_ev_spatk:
    mov r0, #req_spatk_ev
    b return_ev_req

case_ev_spdef:
    mov r0, #req_spdef_ev
    b return_ev_req

ev_return_0:
    mov r0, #0

return_ev_req:
    pop {r4-r7}
    pop {r1}
    bx r1

.align 2
buffer_stat_name:
    push {lr}
    mov r2, r1
    lsl r0, r0, #0x18
    lsr r0, r0, #0x18
    cmp r0, #6
    bgt return_stat_name
    ldr r1, =(rom + stat_name_switch_table)
    lsl r0, r0, #2
    add r0, r0, r1
    ldr r0, [r0]
    mov pc, r0 @ switch jump

stat_name_switch_table:
    .word (rom + stat_name_default)
    .word (rom + case_hp_name)
    .word (rom + case_atk_name)
    .word (rom + case_def_name)
    .word (rom + case_spatk_name)
    .word (rom + case_spdef_name)
    .word (rom + case_spe_name)

stat_name_default:
case_hp_name:
    ldr r1, hp_name_str
    b break_stat_name_switch

case_atk_name:
    ldr r1, atk_name_str
    b break_stat_name_switch

case_def_name:
    ldr r1, def_name_str
    b break_stat_name_switch

case_spe_name:
    ldr r1, spe_name_str
    b break_stat_name_switch

case_spatk_name:
    ldr r1, spatk_name_str
    b break_stat_name_switch

case_spdef_name:
    ldr r1, spdef_name_str

break_stat_name_switch:
    mov r0, r2
    ldr r3, strcpy_xFF_terminated
    bl call_via_r3

return_stat_name:
    pop {r0}
    bx r0

.align 2
use_ev_berry:
    push {r4-r7,lr}
    mov r7, r10
    mov r6, r9
    mov r5, r8
    push {r5-r7}
    lsl r1, r1, #0x18
    lsr r1, r1, #0x18
    mov r8, r0
    mov r7, r1

get_relevant_ev_value:
    mov r0, r8
    mov r1, r7
    mov r2, #0
    ldr r3, get_attr
    bl call_via_r3
    lsl r0, r0, #0x10
    lsr r0, r0, #0x10

check_ev:
    cmp r0, #0
    ble set_ev_unchanged_flag

subtract_ev:
    mov r1, r0
    sub r0, #10
    cmp r0, r1
    blo set_ev
    mov r0, #0

set_ev:
    mov r2, sp
    strh r0, [r2]
    mov r0, r8
    mov r1, r7
    ldr r3, set_attr
    bl call_via_r3

recalc_stats:
    mov r0, r8
    ldr r3, recalculate_stats
    bl call_via_r3
    b get_happiness_value

set_ev_unchanged_flag:
    mov r6, #1

get_happiness_value:
    mov r0, r8
    mov r1, #req_happiness
    mov r2, #0
    ldr r3, get_attr
    bl call_via_r3

check_happiness:
    cmp r0, #255
    beq check_if_should_return_1
    cmp r0, #199
    bgt add_two_happiness
    cmp r0, #99
    bgt add_five_happiness

add_ten_happiness:
    mov r6, #10
    b remember_new_happiness

add_five_happiness:
    mov r6, #5
    b remember_new_happiness

add_two_happiness:
    mov r6, #2

remember_new_happiness:
    add r5, r6, r0

luxuryball_check:
    mov r0, r8
    mov r1, #req_pokeball
    mov r2, #0
    ldr r3, get_attr
    bl call_via_r3
    cmp r0, #item_luxuryball
    bne metlocation_check

luxuryball_bonus:
    add r5, #1
    add r6, #1

metlocation_check:
    mov r0, r8
    mov r1, #req_catch_location
    mov r2, #0
    ldr r3, get_attr
    bl call_via_r3
    mov r4, r0
    ldr r3, sav1_map_get_name
    bl call_via_r3
    lsl r0, r0, #0x18
    lsr r0, r0, #0x18
    cmp r4, r0
    bne soothebell_check

metlocation_bonus:
    add r5, #1
    add r6, #1

soothebell_check:
    mov r0, r8
    mov r1, #req_held_item
    mov r2, #0
    ldr r3, get_attr
    bl call_via_r3
    lsl r0, r0, #0x10
    lsr r0, r0, #0x10
    mov r1, #item_soothebell
    cmp r0, r1
    bne add_happiness

soothebell_bonus:
    lsr r0, r6, #1
    add r5, r0

add_happiness:
    mov r0, r5
    cmp r0, #255
    ble set_happiness
    mov r0, #255

set_happiness:
    mov r2, sp
    strh r0, [r2]
    mov r0, r8
    mov r1, #req_happiness
    ldr r3, set_attr
    bl call_via_r3

return_0:
    mov r0, #0
    b finish_using_ev_berry

check_if_should_return_1:
    cmp r5, #1
    bne return_0

return_1:
    mov r0, #1

finish_using_ev_berry:
    pop {r3-r5}
    mov r8, r3
    mov r9, r4
    mov r10, r5
    pop {r4-r7}
    pop {r1}
    bx r1

happiness_not_at_max_ev_above_0_str:
    .byte 0xFD, 0x02, 0x00, 0xE8, 0xE9, 0xE6, 0xE2, 0xD9, 0xD8, 0x00, 0xDA, 0xE6, 0xDD, 0xD9, 0xE2, 0xD8, 0xE0, 0xED, 0xAD, 0xFE, 0xCE, 0xDC, 0xD9, 0x00, 0xD6, 0xD5, 0xE7, 0xD9, 0x00, 0xFD, 0x03, 0x00, 0xDA, 0xD9, 0xE0, 0xE0, 0xAB, 0xFC, 0x09, 0xFF
    @ "[PKMN] turned friendly.[NEWLINE]The base [STAT] fell![WAITKEYPRESS]"

happiness_up_ev_cant_fall_str:
    .byte 0xFD, 0x02, 0x00, 0xE8, 0xE9, 0xE6, 0xE2, 0xD9, 0xD8, 0x00, 0xDA, 0xE6, 0xDD, 0xD9, 0xE2, 0xD8, 0xE0, 0xED, 0xAD, 0xFE, 0xCE, 0xDC, 0xD9, 0x00, 0xD6, 0xD5, 0xE7, 0xD9, 0x00, 0xFD, 0x03, 0x00, 0xD7, 0xD5, 0xE2, 0xB4, 0xE8, 0x00, 0xDA, 0xD5, 0xE0, 0xE0, 0xAB, 0xFC, 0x09, 0xFF
    @ "[PKMN] turned friendly.[NEWLINE]The base [STAT] can't fall![WAITKEYPRESS]"

adore_ev_down_str:
    .byte 0xFD, 0x02, 0x00, 0xD5, 0xD8, 0xE3, 0xE6, 0xD9, 0xE7, 0x00, 0xED, 0xE3, 0xE9, 0xAB, 0xFE, 0xCE, 0xDC, 0xD9, 0x00, 0xD6, 0xD5, 0xE7, 0xD9, 0x00, 0xFD, 0x03, 0x00, 0xDA, 0xD9, 0xE0, 0xE0, 0xAB, 0xFC, 0x09, 0xFF
    @ "[PKMN] adores you![NEWLINE]The base [STAT] fell![WAITKEYPRESS]"

.align 2
    fcode_buffer2:          .word 0x02021CD0
    fcode_buffer3:          .word 0x02021CF0
    displayed_string:       .word 0x02021D18
    party_player:           .word 0x02024284
    var_8000:               .word 0x020370B8
    var_8001:               .word 0x020370BA
    var_800E:               .word 0x0203AD30
    brm:                    .word 0x0203B0A0
    item_effectiveness:     .word 0x0203B0C0

    tasks:                  .word 0x03005090

    strcpy_xFF_terminated:  .word 0x08008D84|1
    fdecoder:               .word 0x08008FCC|1
    recalculate_stats:      .word 0x0803E47C|1
    get_attr:               .word 0x0803FBE8|1
    set_attr:               .word 0x0804037C|1
    sav1_map_get_name:      .word 0x08056260|1
    audio_play:             .word 0x080722CC|1
    bag_remove_item:        .word 0x0809A1D8|1
    bgid_mark_for_sync:     .word 0x080F67A4|1
    buffer_pkmn_nick:       .word 0x081202E0|1
    item_menu_string:       .word 0x081202F8|1
    item_use_animation:     .word 0x08124DC0|1
    item_menu_callback:     .word 0x081255BC|1
    hp_name_str:            .word 0x084169C2 @ "HP"
    spatk_name_str:         .word 0x084169C5 @ "SP. ATK"
    spdef_name_str:         .word 0x084169CD @ "SP. DEF"
    atk_name_str:           .word 0x08417674 @ "ATTACK"
    def_name_str:           .word 0x0841767B @ "DEFENSE"
    spe_name_str:           .word 0x0841768D @ "SPEED"
    no_effect_str:          .word 0x084169DC @ "It won't have any effect."

The Soothe Bell multiplier acts as it does in Generation IV and onwards (meaning it will also multiply bonuses from the met location and Luxury Ball).

This will introduce the Pomeg Glitch; see tkim's post here on how to fix it.


Spherical Ice' EV-Reducing Berries for FireRed should seriously be indexed in the main thread.
Reply With Quote
  #1375   Link to this post, but load the entire thread.  
Old July 11th, 2018 (8:49 AM).
xizqu's Avatar
xizqu xizqu is offline
 
Join Date: Feb 2018
Location: California
Gender: Male
Nature: Adamant
Posts: 82
Actually, everything after like pg 43 stopped being indexed ??
Reply With Quote
Reply

Quick Reply

Join the conversation!

Create an account to post a reply in this thread, participate in other discussions, and more!

Create a PokéCommunity Account
Ad Content
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 8:46 AM.