Main Menu
Main Page
Forums
Recent changes
Random page
Help

Databases
GlitchDex
AttackDex
ItemDex
TrainerDex
TypeDex
UnownDex
More

Major Glitches
Trainer escape glitch
Old man trick
Celebi Egg trick
Select glitches (Japan)
SRAM glitch
CoolTrainer♀ corruption
LOL glitch
Rival LOL glitch
Super Glitch
ZZAZZ glitch
Pomeg corruption glitch (Glitzer Popping)
Tweaking
Elite Four door glitch (Japan)
Pokémon merge glitch
Pokémon cloning
Time Capsule exploit
Arbitrary code execution
Coin Case glitches
More

Other Glitch Categories
Glitches by generation
Glitches between two generations
Japan-only/language specific glitches
Music glitches
Natural glitches
Non-core series glitches
Non-Pokémon glitches
Officially acknowledged glitches
Recurring glitches
Dead glitches

References
Pokémon GameShark codes
The Big HEX List
Glitch Pokémon cries
GB programming
Curiosities
Debugging features
Easter eggs
Error traps
Glitch areas
Glitch myths
Non-glitch exploits
Placeholder texts
Pokémon glitch terminology
Unused content and prerelease information

Useful Tools
8F Helper
GBz80 to Items
Old man trick name generator
PATH (Prama's Advanced Tweaking Heaven)
Save file editors
Special stat/Pokémon converter
Trainer escape Trainer Pokémon finder

Affiliates
Legendary Star Blob 2 (Hakuda)
Pokémon Speedruns wiki
PRAMA Initiative
Become an affiliate!

Technical
Site Source Code

Search Wiki

 

Search Forums

 

Author Topic: Gameshark code limit  (Read 1277 times)

0 Members and 1 Guest are viewing this topic.

iamnguyen

  • GCLF Member
  • Offline Offline
  • CHARIZRAD 'M ROXORX or is it.
    • View Profile
Gameshark code limit
« on: July 16, 2016, 06:17:45 pm »
Hello, I am new to Gameshark code. Any help is much appreciated.

I wonder how stat modifier works. For example:

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

TheUnReturned

  • A strange guy
  • GCLF Member
  • *
  • Offline Offline
  • Gender: Male
  • Yawns
    • View Profile
Re: Gameshark code limit
« Reply #1 on: July 16, 2016, 09:49:40 pm »
Hello, I am new to Gameshark code. Any help is much appreciated.

I wonder how stat modifier works. For example:

Quote
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
Always treasure the present
To remain it in the past

iamnguyen

  • GCLF Member
  • Offline Offline
  • CHARIZRAD 'M ROXORX or is it.
    • View Profile
Re: Gameshark code limit
« Reply #2 on: July 16, 2016, 11:27:13 pm »
Thank you for your response, but does that mean the limit will be 510, not 999?

TheUnReturned

  • A strange guy
  • GCLF Member
  • *
  • Offline Offline
  • Gender: Male
  • Yawns
    • View Profile
Re: Gameshark code limit
« Reply #3 on: July 17, 2016, 12:32:42 am »
Thank you for your response, but does that mean the limit will be 510, not 999?
sadly, I think that's the case.
Always treasure the present
To remain it in the past

TheZZAZZGlitch

  • Distinguished Member
  • *
  • Offline Offline
  • Gender: Male
  • Unknown opcode fc at 801a
    • View Profile
Re: Gameshark code limit
« Reply #4 on: July 17, 2016, 12:44:49 am »
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
qÁF qÁF qÁF qÁF qÁF qÁF qÁF qÁF qÁF qÁF qÁF qÁF qÁF qÁF qÁF qÁF qÁF qÁF qÁF qÁF qÁF qÁF qÁF qÁF qÁF qÁF

iamnguyen

  • GCLF Member
  • Offline Offline
  • CHARIZRAD 'M ROXORX or is it.
    • View Profile
Re: Gameshark code limit
« Reply #5 on: July 17, 2016, 01:13:52 am »
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).