Glitch City Laboratories Archives

Glitch City Laboratories closed on 1 September 2020 (announcement). This is an archived copy of a thread from Glitch City Laboratories Forums.

You can join Glitch City Research Institute to ask questions or discuss current developments.

You may also download the archive of this forum in .tar.gz, .sql.gz, or .sqlite.gz formats.

Arbitrary Code Execution Discussion

Pokemon Yellow Hidden Power DVs with w sm - Page 1

Pokemon Yellow Hidden Power DVs with w sm

Posted by: Miku
Date: 2018-09-25 08:49:24
I would really appreciate if someone could help me out with Yellow's w sm glitch item.

I know how to use w sm in Yellow. I've used it countless times to obtain max DV Pokémon, to clone items and to change Mew's OT/ID information to GF/22796, which is the event Mew that was distributed a couple years ago.

However, I've done all those code executions following instructions made by others. I don't understand what the items correspond to in terms of code etc. I assume that there are a lot of folks here that know how specific arbitrary code is created, so could some one please generate a code / item list for Yellow's w sm item that would be similar to the max DV code?

The video I used as my guide was this: https://www.youtube.com/watch?v=jR5rov2e6PU&t=804s

So basically I assume the setup would be exactly the same as it is in that video, but the item list would be different. Also, it would be awesome if the code only changes the DVs and does not max out stat experience. (I really don't like soft-resetting e.g. Zapdos for a week or so just to get a Hidden Power spread, but I wouldn't mind training one legitimately.) If it isn't possible to generate a code that doesn't max out stat experience, it's fine, but I would just prefer it to just affect the DVs.

I'm looking for the following DV spreads:

7 / 14 / 13 / 15 / 15 (Hidden Power Water)
15 / 15 / 13 / 15 / 15 (Hidden Power Ice)
7 / 14 / 15 / 15 / 15 (Hidden Power Electric)
3 / 14 / 14 / 15 / 15 (Hidden Power Grass)

The Hidden Power spreads are mainly for the Kanto's legendary birds, as I would like to use them in Crystal's Battle Tower.

Re: Pokemon Yellow Hidden Power DVs with w sm

Posted by: Torchickens
Date: 2018-09-25 10:25:16
Sure. It's definitely possible. :)

D185 is the Attack/Defense IV combined and D186 is the Speed/Special IV combined. According to Smogon, the HP DV is calculated automatically from these values (in terms of the HP DV "An odd Attack DV adds 8, Defense adds 4, Speed adds 2, and Special adds 1"), so you don't need to worry about setting it directly; it will come automatically.

In these structures, the left-most nybble represents the first IV and the right-most nybble represents the second IV. For example, if D185 is "94", this would mean Attack IV=9, Defense IV=4. Likewise FA would mean Attack IV=F (which converted into decimal is 15) and Defense IV=A (which is converted into decimal is 10). Likewise, if D186 was "9A", this would mean Speed IV=9 and Special IV=A (which converts into 10), etc.


With those rules, try the following.

(item 3;)

Lemonade x(Attack/Defense IVs combined nybbles)
Carbos x209
X Accuracy x133
Water Stone x4
Lemonade x(Speed/Special IVs combined nybbles)
Water Stone x201

To get multiple stacks, first obtain 99 of the item and buy/get another or get x0 stacks with Celadon looping map glitch that you can toss from, as these are x256.

Source code:

ld a,xx
ld h,D1
ld l,85
ld (hli),a
inc b
ld a,yy
ld (hli),a
ret


The Lemonade values you need:

Hidden Power Water:

Lemonade (first) x237
Lemonade (second) x 255

(Write ED to D185 and FF to D186) (because E means 14 Attack, D means 13 Defense, F means 15 Speed, F means 15 Special)

Hidden Power Ice:

Lemonade (first) x253
Lemonade (second) x255

(Write FD to D185, and FF to D186)

Hidden Power Electric:

Lemonade (first) x239
Lemonade (second) x255

(Write EF to D185, and FF to D186)

Hidden Power Grass:

Lemonade (first) x238
Lemonade (second) x255

(Write EE to D185, and FF to D186)

If you have reusable RAM writer you can write the values indicated in the brackets with a hexadecimal to decimal converter. For instance, "EE" would be Lemonade x238, "D1" would be Carbos x209, "85" would be X Accuracy x133.

Good luck and let me know if you have any questions/issues.

(I deleted your other post now that this is answered)

Re: Pokemon Yellow Hidden Power DVs with w sm

Posted by: Miku
Date: 2018-09-27 08:33:02
Hi and thanks a lot for your answer! :) There are a couple questions I would like to ask though. E.g. when trying to get a HP Ice spread, I should have the following setup:

Lemonade x253
Carbos x209
X Accuracy x133
Water Stone x4
Lemonade x255
Water Stone x201

However, where do I have to put w sm in? Is it the first item above anything else? Also, does it matter if I have any items below this setup in my bag?

And how many times do I have to use w sm? Also, should I basically do the same thing that was done in the video, which is to first use w sm and after that, deposit the Pokémon I want to be affected to the PC and then its DVs will be changed?

Re: Pokemon Yellow Hidden Power DVs with w sm

Posted by: Torchickens
Date: 2018-09-27 10:34:03
You're welcome :)

All of these codes will change party Pokémon 1 DVs. Depositing it into the PC is technically not required but recommended for the Pokémon's HP/Attack/Defense/Speed/Special stats to update; you can deposit it and withdraw it again to update its current stats thanks to the box trick; so the DVs are changed right away; the game just needs to do something that would update its current stats (similar to if a Pokémon gained stat experience it still needs to level up or be withdrawn again for the changes to apply).

For this code and with the 'run item 3' bootstrap setup (most of the ones posted on this forum), the items are placed from slot 3 unless stated otherwise and ws m can go in any slot that isn't slot 3-8, so item slot 1 would work. The x201 functions as an 'end of code' in this case basically (in other codes it may be represented by TM01), and you can have any items you want below it.

You should only have to use ws m once for each DV spread you want (e.g. use it once for the Hidden Power Ice spread).

Hope this helps.

Re: Pokemon Yellow Hidden Power DVs with w sm

Posted by: Miku
Date: 2018-09-27 16:41:32
I just tried the codes and they give wrong DV spreads. E.g the HP Water code gives a spread with 7/15/15/15 DVs (Atk/Def/Special/Speed)

My item setup for the HP Water code is:

w sm
Lemonade x237
Carbos x209
X Accuracy x133
Water Stone x4
Lemonade x255
Water Stone x201

Then there are some random items below these but that shouldnt matter, right? I put Zapdos first in the party and used w sm once and its DV spread became 15/7/15/15/15 (HP/Ark/Def/Special/Speed).

My PC bootstrap setup is the same as in the video I linked, which is (in order): Slowpoke with 233 HP, Slowpoke x5, L37 Voltorb, L26 Growlithe, L7 Jolteon, Geodude x10, Voltorb.

I assume Im doing something wrong here, as the codes are giving me wrong spreads?

Re: Pokemon Yellow Hidden Power DVs with w sm

Posted by: Torchickens
Date: 2018-09-27 17:35:52
Are the items other than ws m in slot 3? (it won't work properly if they begin at slot 2). Another possible issue may be because the stats won't be updated until you deposit and withdraw the Pokémon/level it up, a DV calculator may still return the wrong DVs.

Re: Pokemon Yellow Hidden Power DVs with w sm

Posted by: Miku
Date: 2018-09-28 07:38:22
It didn't work because the items started from the number 2 slot (w sm was the first one). I tried again with the items beginning from slot 3 and it worked. Thanks so much! This saves me a lot of time as I don't have to softreset the legendaries. :)

Could you also give a code for a HP Flying spread, please? The DVs required are 12/13/15/15?

Re: Pokemon Yellow Hidden Power DVs with w sm

Posted by: Torchickens
Date: 2018-09-29 04:29:34

It didn't work because the items started from the number 2 slot (w sm was the first one). I tried again with the items beginning from slot 3 and it worked. Thanks so much! This saves me a lot of time as I don't have to softreset the legendaries. :)

Could you also give a code for a HP Flying spread, please? The DVs required are 12/13/15/15?


I see, easily done.

Pleasure :). Glad you got it to work in the end!

In order to get Hidden Power Flying, try:

Lemonade (first) x205  (because 12|13 is C|D, CD in decimal is 205)
Lemonade (second) x255

Re: Pokemon Yellow Hidden Power DVs with w sm

Posted by: Miku
Date: 2018-10-04 05:37:00
Thanks again so much! :)

Could you also give the setups for Hidden Power Fire (14/12/15/15), Ghost (13/14/15/15), Bug (13/13/15/15), Rock (13/12/15/15), Ground (12/15/15/15), Fighting (12/12/15/15) and finally, shiny IVs (15/10/10/10). These will be the last ones I need, as there are no other good Hidden Powers to use besides these.