# 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.

## Generation II Glitch Discussion

### Mobile Trade received Pokémon data structure - Page 1

Previous Page

- 1

Next Page

#### Mobile Trade received Pokémon data structure

Posted by: Torchickens
Date: 2016-05-31 08:06:31
In Japanese Pokémon Crystal, when the value of SRAM 05:A800 is set to 04; you will receive a traded Pokémon the next time you step into the Pokémon Communication Center in Goldenrod City. It will appear in the Pokédex.
After you receive the Pokémon, you will get the text "まま！のてみっってで なのなまでっててくだね そではまのまちてま！" (translated: Thank you for your
patience. A trade partner has been found. It's your new partner. Please take care of it with love. We hope to see you again.)
Creating your own Mobile Trade Pokémon should be possible with Japanese Pokémon Crystal arbitrary code execution (thanks to luckytyphlosion, Háčky, Paco81's finds), such as through TM15 ACE (TM15 when used outside of the TM/HM pocket executes FA10).
You can obtain a hex:00 ????? through the bad clone glitch and withdraw Pokémon without mail to convert it into ????? FF, use hex:FF Missingning's items corruption; and follow the steps in the thread, and then manipulate FB84 (in the expanded balls pocket) to a value such as (item x195), Star Piece x 251 (jp FB84; box 4 name character 2).
This code will enable the trade (thanks Crystal_ for the skeleton). We just need to find a way to adapt it for a structure such as box names or stored items.
`ld a,05
ld (4e01),a
ld a,0a
ld (0d01),a
ld a,04
ld (a800),a
ret`

Data structure (work in progress):
A800: If it is 04, obtain a Pokémon in the PCC.
A826: Species of received Pokémon modifier (e.g. FB=Celebi).
B029: Held item of received Pokémon.
B02A: Move 1 of received Pokémon.
B02B: Move 2 of received Pokémon.
B02C: Move 3 of received Pokémon.
B02D: Move 4 of received Pokémon.
B02E, B02F: ID number of received Pokémon.
B030, B031, B032: Experience of received Pokémon.
B033, B034: HP stat experience of received Pokémon.
B035, B036: Attack stat experience of received Pokémon.
B037, B038: Defense stat experience of received Pokémon.
B039, B03A: Speed stat experience of received Pokémon.
B03B, B03C: Special stat experience of received Pokémon.
B03D: Attack/Defense IV of received Pokémon.
B03E: Speed/Special IV of received Pokémon.
B03F: Received Pokémon's PP of move 1.
B040: Received Pokémon's PP of move 2.
B041: Received Pokémon's PP of move 3.
B042: Received Pokémon's PP of move 4.
B058: Received Pokémon's OT name character 1.
B059: Received Pokémon's OT name character 2.
B05A: Received Pokémon's OT name character 3.
B05B: Received Pokémon's OT name character 4.
B05C: Received Pokémon's OT name character 5.
B05D: Nickname of received Pokémon, character 1.
B05E: Nickname of received Pokémon, character 2.
B05F: Nickname of received Pokémon, character 3.
B060: Nickname of received Pokémon, character 4.
B061: Nickname of received Pokémon, character 5.

#### Re: Mobile Trade received Pokémon data structure

Posted by: Stackout
Date: 2016-05-31 11:10:04
I note that B029 to B042 is very similar (if not exactly the same as) the Gen2 Pokémon data structure (0x01 on).

#### Re: Mobile Trade received Pokémon data structure

Posted by: Torchickens
Date: 2016-05-31 13:16:26

> I note that B029 to B042 is very similar (if not exactly the same as) the Gen2 Pokémon data structure (0x01 on).

Yes. I'm still looking to see if you can change the level, I think I may have guessed where it was based on the data structure pattern above but not found it.
I successfully got a Celebi at level 2 named "?????" with 16449536 experience using the following box names:
Box 4: ぼづ
Box 5: ぼづぼ
Box 6:
Box 7: づべべべべべ
Box 8: づ
Box 9: だづの
After making it jump to level 100, it learned five moves. I replaced Baton Pass with Perish Song and it now looks like this!
[img]http://i.imgur.com/nAaMmYu.png[/img][img]http://i.imgur.com/WU8X1qi.png[/img][img]http://i.imgur.com/RibJWXO.png[/img]
ASM:
`
ld a,05
ld h,40
ld l,40
ldd (hl),a
ld d,b
ld a,0A
ld h,0D
ldd (hl),a
ld a,05
dec a
ld d,b
ld h,A8
ld l,05
dec l
dec l
dec l
dec l
ld d,b
dec l
xor a
dec a
dec a
dec a
dec a
dec a
ld d,b
ld h,A8
ld l,26
ldd (hl),a
ld h,B0
ld d,b
ld d,b
ld l,30
ldd (hl),a
ret
ld d,b
ld d,b
`
Code:
`3E 05 26 40 2E 40 32 50 3E 0A 26 0D 32 3E 05 3D 50 26 A8 2E 05 2D 2D 2D 2D 50 2D 32 AF 3D 3D 3D 3D 3D 50 26 A8 2E 26 32 26 B0 50 50 2E 30 32 C9 50 50`

#### Re: Mobile Trade received Pokémon data structure

Posted by: shaggs
Date: 2016-11-06 15:09:10

> > I note that B029 to B042 is very similar (if not exactly the same as) the Gen2 Pokémon data structure (0x01 on).

> Yes. I'm still looking to see if you can change the level, I think I may have guessed where it was based on the data structure pattern above but not found it.
> I successfully got a Celebi at level 2 named "?????" with 16449536 experience using the following box names:
> Box 4: ぼづ
> Box 5: ぼづぼ
> Box 6:
> Box 7: づべべべべべ
> Box 8: づ
> Box 9: だづの
> After making it jump to level 100, it learned five moves. I replaced Baton Pass with Perish Song and it now looks like this!
> [img]http://i.imgur.com/nAaMmYu.png[/img][img]http://i.imgur.com/WU8X1qi.png[/img][img]http://i.imgur.com/RibJWXO.png[/img]
> ASM:
> `
> ld a,05
> ld h,40
> ld l,40
> ldd (hl),a
> ld d,b
> ld a,0A
> ld h,0D
> ldd (hl),a
> ld a,05
> dec a
> ld d,b
> ld h,A8
> ld l,05
> dec l
> dec l
> dec l
> dec l
> ld d,b
> dec l
> xor a
> dec a
> dec a
> dec a
> dec a
> dec a
> ld d,b
> ld h,A8
> ld l,26
> ldd (hl),a
> ld h,B0
> ld d,b
> ld d,b
> ld l,30
> ldd (hl),a
> ret
> ld d,b
> ld d,b
> `
> Code:
> `3E 05 26 40 2E 40 32 50 3E 0A 26 0D 32 3E 05 3D 50 26 A8 2E 05 2D 2D 2D 2D 50 2D 32 AF 3D 3D 3D 3D 3D 50 26 A8 2E 26 32 26 B0 50 50 2E 30 32 C9 50 50`

Wow that is great, how do you even go about figuring stuff
like this out?

#### Re: Mobile Trade received Pokémon data structure

Posted by: Yeniaul
Date: 2016-11-08 19:36:08
Knowing z80 ASM helps. BGB helps too. :P

#### Re: Mobile Trade received Pokémon data structure

Posted by: ISSOtm
Date: 2016-11-09 03:41:28
That's GBz80, to be picky on names :P
And yeah, BGB sure is one precious treasure.
(Be sure to check out that GB programming page on the wiki ! It's in the fifth sidebar box !)
Previous Page

- 1

Next Page