ItemDex/RB:093: Difference between revisions

Jump to navigation Jump to search
Content added Content deleted
(→‎Bootstrapping: Added the Tentacool setup.)
(→‎Bootstrapping: Folded the old setups into a single collapsed section, and added an adaptation of the new setup for European versions.)
Line 52: Line 52:
}}
}}


===5 Pokémon "233 HP Pidgey" setup===
=== Older setups ===
{{Explanation|title=Details|contents=
'''5 Pokémon "233 HP Pidgey" setup'''

The "233 HP Pidgey" setup used to be the most popular 8F setup, although it is considered outdated due to the difficulty of controlling the exact HP value of a Pokémon. It consists of 5 valid Pokémon, with one of them having a specific current HP value:
The "233 HP Pidgey" setup used to be the most popular 8F setup, although it is considered outdated due to the difficulty of controlling the exact HP value of a Pokémon. It consists of 5 valid Pokémon, with one of them having a specific current HP value:
# 5 Pokémon
# 5 Pokémon
Line 67: Line 70:


The bootstrap code translates to the following ASM:
The bootstrap code translates to the following ASM:
<pre>

; Initial hl = D163
; Initial hl = D163
$D163 <- 05 || dec b
$D163 <- 05 || dec b
$D164 <- 24 || inc h ; h = D2
$D164 <- 24 || inc h ; h = D2
$D165 <- 2E ||
$D165 <- 2E ||
$D166 <- 22 || ld l, 22 ; hl = D222
$D166 <- 22 || ld l, 22 ; hl = D222
$D167 <- 18 ||
$D167 <- 18 ||
$D168 <- 02 || jr 02 ; pc = D16B
$D168 <- 02 || jr 02 ; pc = D16B
$D169 <- FF ||
$D169 <- FF ||
$D16A <- FF ||
$D16A <- FF ||
$D16B <- 24 || inc h ; h = D3
$D16B <- 24 || inc h ; h = D3
$D16C <- 00 || nop
$D16C <- 00 || nop
$D16D <- E9 || jp hl ; pc = D322
$D16D <- E9 || jp hl ; pc = D322
</pre>


Understanding the ASM will allow modifying the setup to suit different needs. For example, to make 8F run code starting from item 1 ($D31E), replace the Onix (0x22) with a Tangela (0x1E).
Understanding the ASM will allow modifying the setup to suit different needs. For example, to make 8F run code starting from item 1 ($D31E), replace the Onix (0x22) with a Tangela (0x1E).


===6 Pokémon "233 HP Pidgey" setup===
'''6 Pokémon "233 HP Pidgey" setup'''

A slight modification to the above setup allows a full team of 6 Pokémon, with any Pokémon at the front, which may be desirable when using an instant encounter script, for example (the lead Pokémon can be used to weaken the enemy Pokémon, and when the enemy is caught it's sent to the PC without messing up the setup).
A slight modification to the above setup allows a full team of 6 Pokémon, with any Pokémon at the front, which may be desirable when using an instant encounter script, for example (the lead Pokémon can be used to weaken the enemy Pokémon, and when the enemy is caught it's sent to the PC without messing up the setup).


Line 96: Line 101:


ASM translation:
ASM translation:
<pre>
$D163 <- 06 ||
$D164 <- ?? || ld b, ??
$D165 <- 24 || inc h ; h = D2
$D166 <- 2E ||
$D167 <- 22 || ld l, 22 ; hl = D222
$D168 <- 18 ||
$D169 <- 2D || jr 2D ; pc = D197
(...)
$D197 <- 24 || inc h ; h = D3
$D198 <- 00 || nop
$D199 <- E9 || jp hl ; pc = D322
</pre>


'''3 Pokémon super-compressed setup'''
$D163 <- 06 ||
$D164 <- ?? || ld b, ??
$D165 <- 24 || inc h ; h = D2
$D166 <- 2E ||
$D167 <- 22 || ld l, 22 ; hl = D222
$D168 <- 18 ||
$D169 <- 2D || jr 2D ; pc = D197
(...)
$D197 <- 24 || inc h ; h = D3
$D198 <- 00 || nop
$D199 <- E9 || jp hl ; pc = D322


===3 Pokémon super-compressed setup===
It is possible to use a super-compressed setup, but it requires some difficult to obtain glitch Pokémon, namely [[GlitchDex/RB:195|h POKé (0xC3)]] and [[GlitchDex/RB:211|M p'u ゥ (0xD3)]].
It is possible to use a super-compressed setup, but it requires some difficult to obtain glitch Pokémon, namely [[GlitchDex/RB:195|h POKé (0xC3)]] and [[GlitchDex/RB:211|M p'u ゥ (0xD3)]].
# 3 to 5 Pokémon
# 3 to 5 Pokémon
Line 117: Line 124:


ASM translation:
ASM translation:
<pre>

$D163 <- 03/04/05 || inc bc / inc b / dec b
$D163 <- 03/04/05 || inc bc / inc b / dec b
$D164 <- C3 ||
$D164 <- C3 ||
$D165 <- 22 ||
$D165 <- 22 ||
$D166 <- D3 || jp $D322
$D166 <- D3 || jp $D322
</pre>


Notice that this setup doesn't set hl to $D322, which some common item setups assume. For those item setups, inserting two items will fix this problem:
Notice that this setup doesn't set hl to $D322, which some common item setups assume. For those item setups, inserting two items will fix this problem:
Line 130: Line 138:
# (Listed items)
# (Listed items)
(credits to [https://archives.glitchcity.info/forums/board-115/thread-6638/page-37.html#msg204534 NukingDragons] for this fix)
(credits to [https://archives.glitchcity.info/forums/board-115/thread-6638/page-37.html#msg204534 NukingDragons] for this fix)
}}


===In other European versions===
===In other European versions===
In other European versions, the 8F item is named 7EME ETAGE (French) / S7 (German) / 7°P (Italian) / P7 (Spanish). It still executes code the same way, but the setup will be different due to differences in the memory layout, with the third item at $D327 rather than $D322.
In other European versions, the 8F item is named 7EME ETAGE (French) / S7 (German) / 7°P (Italian) / P7 (Spanish). It still executes code the same way, but the setup will be different due to differences in the memory layout, with the third item at $D327 rather than $D322.


For the above three setups, the common fix is to replace the Onix with a Graveler (or to replace the Tangela with a Fearow to run code starting from item 1).
The "Tentacool PPs" setup above can be adapted to those European versions by having 39 PP for the 2nd move instead of 34. For the three setups in the "Older setups" section, the common fix is to replace the Onix with a Graveler (or to replace the Tangela with a Fearow to run code starting from item 1).


==See also==
==See also==