Main Menu
Main Page
Forums
Recent changes
Random page
Help

Databases
GlitchDex
AttackDex
ItemDex
TypeDex
UnownDex
More

Major Glitches
Trainer escape glitch
Old man trick
Celebi 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 glitch
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
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!

Search Wiki

 

Search Forums

 

Author Topic: J glitch item  (Read 141 times)

0 Members and 1 Guest are viewing this topic.

likebeingawesome

  • The game reset master
  • GCLF Member
  • Offline Offline
  • Gender: Male
  • DARN IT I RESET MY GAME
    • View Profile
J glitch item
« on: July 09, 2017, 12:32:07 pm »
I was wondering if I could get more information on this item. Including why it exists between your items and the area with random items when performing item underflow. As well as what it does and why it sells for 414925 pokedollars in sI shops.
« Last Edit: July 09, 2017, 12:33:11 pm by likebeingawesome »
I need to double check codes before I use them

<a href="http://www.pokeplushies.com"><img src="http://www.pokeplushies.com/myplushie/20783.png"></a>

TheZZAZZGlitch

  • Distinguished Member
  • *
  • Offline Offline
  • Gender: Male
  • Unknown opcode fc at 801a
    • View Profile
Re: J glitch item
« Reply #1 on: July 09, 2017, 04:12:07 pm »
'j.' is a glitch item with hex ID 00.
You get to see it a lot during item underflow, simply because 0 is a popular number and it occurs many times throughout the game's memory. Which is what item underflow really is - viewing the memory beyond inventory data as items.

This item happens to execute code from $01D1, which is in the middle of map header pointers. This garbage code (which isn't really game code, but the game has to interpret it somehow) eventually causes a jump to $BE42, in the middle of SRAM.
It could be potentially used for arbitrary code execution, although only theoretically, since there's no easy way to control data at $BE42 without cheating or resorting to another form of arbitrary code execution.

j.'s sell price of 414925 is completely accidental.
The game keeps a table of all item prices. This table only has 96 entries. Item 0 is actually interpreted as item 256, so the game tries to grab the 256th entry of this list, and ends up reading past the table.
Just so happens, item names are located there, and the game reads the last 3 bytes of "X ACCURACY(end marker)" (0x82, 0x98, 0x50) as an item price.

So, the item's buy price is 829850.
The sell price is dynamically calculated by the game to be the half of the buy price.
829850 divided by 2 is - you guessed it - 414925.
« Last Edit: July 09, 2017, 04:13:11 pm by TheZZAZZGlitch »
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

likebeingawesome

  • The game reset master
  • GCLF Member
  • Offline Offline
  • Gender: Male
  • DARN IT I RESET MY GAME
    • View Profile
Re: J glitch item
« Reply #2 on: July 09, 2017, 04:16:44 pm »
Thanks for telling me this is really cool
I need to double check codes before I use them

<a href="http://www.pokeplushies.com"><img src="http://www.pokeplushies.com/myplushie/20783.png"></a>