Deconstructing Pokémon glitches?

前端 未结 3 788
北荒
北荒 2021-02-01 15:20

(I apologize if this is the wrong place to ask this. I think it\'s definitely programming related, though if this belongs on some other site please let me know)

I grew u

3条回答
  •  Happy的楠姐
    2021-02-01 15:59

    Mystery solved! It looks like user TheZZAZZGlitch figured out what causes this.

    The glitch is triggered when the game tries to compute an extremely large integer. Internally, the game has a routine that repeatedly adds values to simulate a multiplication. It seems to write bytes as it goes, shifting over an output write position. The code is designed to cut off any value that exceeds 0x009999 so that the player doesn't earn more than $9999 from a trainer battle (the values are stored in hexadecimally-coded decimal). However, the game forgets to reset the output pointer when this occurs, so if an extremely large number is generated, the game will repeatedly write the pattern 0x009999 across RAM by shifting the write pointer over and writing 0x99 to two out of every three bytes.

    Hope this helps!

提交回复
热议问题