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

## Tech Help

### Gameshark code limit - Page 1

Previous Page

- 1

Next Page

#### Gameshark code limit

Posted by: iamnguyen
Date: 2016-07-16 19:17:45
Hello, I am new to Gameshark code. Any help is much appreciated.
I wonder how stat modifier works. For example:

> Special Modifier
> 01??C0DA
> 01??C1DA

What do I change for each line? Let's say I want to change the special of my pokemon to 999, what value do I need to have? Please help. Thank you very much in advance.

#### Re: Gameshark code limit

Posted by: TheUnReturned
Date: 2016-07-16 22:49:40

> Hello, I am new to Gameshark code. Any help is much appreciated.
> I wonder how stat modifier works. For example:

> > Special Modifier
> > 01??C0DA
> > 01??C1DA

> What do I change for each line? Let's say I want to change the special of my pokemon to 999, what value do I need to have? Please help. Thank you very much in advance.

First of all, it'll be actually 01??C1DA + 01??C2DA
This is used to change the special of the third Pokemon.
If I remembered correctly, the final special will be the sum of the both ??
Example: 01FFC1DA + 0102C2DA
Then the third Pokemon's special will be FF(255) + 02(2) = 257 special
The whole hex-to-number can be viewed here:
http://forum.renoise.com/uploads/post-1028-0-62901100-1416239611.png

#### Re: Gameshark code limit

Posted by: iamnguyen
Date: 2016-07-17 00:27:13
Thank you for your response, but does that mean the limit will be 510, not 999?

#### Re: Gameshark code limit

Posted by: TheUnReturned
Date: 2016-07-17 01:32:42

> Thank you for your response, but does that mean the limit will be 510, not 999?

sadly, I think that's the case.

#### Re: Gameshark code limit

Posted by: TheZZAZZGlitch
Date: 2016-07-17 01:44:49
Nope.
Take the value you want to get, let's say 456, divide it by 256, and only take the whole part (this is "integer division"):
456 div 256 = 1
Then take the original value again, divide it by 256 and take the remainder (this is "modulo"):
456 mod 256 = 200
Convert the results into hex:
01 C8
And finally, replace the ?? spots in the GameShark codes:
0101C0DA
01C8C1DA
If it works incorrectly, try putting the bytes in a reverse order (Gen I is very inconsistent with its endianness, the least significant byte sometimes goes first, sometimes goes last).
Although I'm not sure where you got the codes in the first place, they point to the second PC Pokemon's moves.
Alternatively, you can just convert the target value into hex and split it every two numbers, adding a leading zero if necessary:
456 = 0x1C8 = 0x01C8
So the values are: 01, C8
Without entering any math details, the first number is the "multiples of 256", and the second is added to the first number. So with 01 C8:
1 * 256 + 0xC8 = 256 + 200 = 456

#### Re: Gameshark code limit

Posted by: iamnguyen
Date: 2016-07-17 02:13:52
Thank you, the famed TheZZAZZGlitch. This makes perfect sense. I'm trying to use Gameshark codes through arbitrary code execution (I know this is lame, I'm really a beginner).
Previous Page

- 1

Next Page