Generation I item codes: Difference between revisions

Jump to navigation Jump to search
Content added Content deleted
old->Sherkel
m (Category)
(Added the code to fix -gm bootstrap.)
Line 3: Line 3:
For a list of hex values for all Generation I Items and their corresponding assembly instructions, see [[the Big HEX List]].
For a list of hex values for all Generation I Items and their corresponding assembly instructions, see [[the Big HEX List]].


The following example setups are for the glitch item [[ItemDex/RB:093|8F]]. The most popular bootstrap strategies for 8F jumps to the '''third item in the item pack''' ($D322 in English R/B, $D321 in English Yellow), leaving the first two item slots for 8F itself and possibly any item (that is not part of the code) to be manipulated. Most setups work for all other methods of ACE, as long as they jump to the third item in the item pack during bootstrap.
Most of the following example setups are for the glitch item [[ItemDex/RB:093|8F]]. The most popular bootstrap strategies for 8F jumps to the '''third item in the item pack''' ($D322 in English R/B, $D321 in English Yellow), leaving the first two item slots for 8F itself and possibly any item (that is not part of the code) to be manipulated. Most setups work for all other methods of ACE, such as [[ItemDex/RB:106|-gm]] or [[Arbitrary code execution#Via text boxes|text box ACE]], as long as they jump to the third item in the item pack during bootstrap.


Some of the item codes further assume that the jump is made by a "jp hl" instruction, which means that hl also contains the address of the third item. That means those item codes will not work with the "super-compressed" setups that jump to the code with "jp $xxyy" (or any other jump instruction), unless further steps are taken to set hl to the desired value.
Some of the item codes further assume that the jump is made by a "jp hl" instruction, which means that hl also contains the address of the third item. That means those item codes will not work with the "super-compressed" setups that jump to the code with "jp $xxyy" (or any other jump instruction), unless further steps are taken to set hl to the desired value.


See [http://forums.glitchcity.info/index.php?topic=6638.0 the forum topic on 8F] for more examples of item codes.
See [http://forums.glitchcity.info/index.php?topic=6638.0 the forum topic on 8F] for more examples of item codes.

== Fix -gm bootstrap ==
Due to limitations on space and the available character set, the [[ItemDex/RB:106#Initial luckytyphlosion bootstrap|initial bootstrap strategy for -gm]] designed by luckytyphlosion jumps to the ''second'' item in the item pack, which might make it inconvenient to make use of existing item codes and/or manipulate items. The below item code<ref name="lucky_guide">[https://pastebin.com/iGyyJstG Rough -gm guide (v0.1)] by luckytyphlosion</ref> is designed to fix this by modifying the initial bootstrap, inserting two "inc hl" instructions before "jp hl":
-gm
Thunderstone x1
TM17 x2
X Accuracy x79
Protein x2
Antidote x62
HP Up x2
Water Stone x2
Burn Heal x34
Parlyz Heal x62
TM33 x2
X Speed x34
TM01 x[any qty]

After setting up the item list and using -gm once, the jump target of -gm will be changed to the third item in the item pack.

The code is designed to be spelled with distinct items that are easy to buy in the Celadon Department Store. As a result, there are a lot of dummy instructions that can be adjusted according to the player's situation.
<b>ld hl, $D901</b>
ld [bc], a
<b>ld l, $4F</b>
<b>inc h</b> ; hl = $DA4F
ld [bc], a
dec bc
<b>ld a, $23</b> ; opcode for "inc hl"
ld [bc], a
<b>ld [hli], a</b>
ld [bc], a
inc c
<b>ld [hli], a</b>
rrca
<b>ld a, $E9</b> ; opcode for "jp hl"
ld [bc], a
ld b,e
<b>ld [hli], a</b>
<b>ret</b>


==Non-key item duplication==
==Non-key item duplication==
Line 76: Line 114:
Note: Pokémon obtained this way are registered in the Pokédex, so getting [[MissingNo.]] this way will duplicate the 6th item. It would be necessary to toss TM05 x128 before using the code again.
Note: Pokémon obtained this way are registered in the Pokédex, so getting [[MissingNo.]] this way will duplicate the 6th item. It would be necessary to toss TM05 x128 before using the code again.


== References ==
<references />
[[Category:Arbitrary code execution]]
[[Category:Arbitrary code execution]]