Jump to content

ItemDex/RB:093: Difference between revisions

(→‎Bootstrapping: Added the Tentacool setup.)
 
(One intermediate revision by one other user not shown)
Line 21:
 
For example applications of 8F, see [[Generation I item codes]]. Notice that all applications involving an item list need a bootstrap code to work.
 
During the start of the execution of 8F, the following registers and stats are expected to be constant:
 
*a=63
*bc=00b8
*de=0001
*hl=d163
*Flags z, n, h, c are not set
*lcdc=E3
*ie=0D
*if=F0
*spd=0
*rom=3 (FFB8; loaded ROM bank)
*ime=1
*ima=1
 
==Bootstrapping==
Line 52 ⟶ 67:
}}
 
===5 PokémonOlder "233setups HP Pidgey" setup===
{{Explanation|title=Details|contents=
===3'''5 Pokémon super-compressed"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:
# 5 Pokémon
Line 67 ⟶ 85:
 
The bootstrap code translates to the following ASM:
<pre>
 
; Initial hl = D163
$D163 <- 05 || dec b
$D164 <- 24 || inc h ; h = D2
$D165 <- 2E ||
$D166 <- 22 || ld l, 22 ; hl = D222
$D167 <- 18 ||
$D168 <- 02 || jr 02 ; pc = D16B
$D169 <- FF ||
$D16A <- FF ||
$D16B <- 24 || inc h ; h = D3
$D16C <- 00 || nop
$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).
 
==='''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).
 
Line 96 ⟶ 116:
 
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)]].
# 3 to 5 Pokémon
Line 117 ⟶ 139:
 
ASM translation:
<pre>
 
$D163 <- 03/04/05 || inc bc / inc b / dec b
$D164 <- C3 ||
$D165 <- 22 ||
$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:
Line 130 ⟶ 153:
# (Listed items)
(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, 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.
 
ForThe 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==
Cookies help us deliver our services. By using our services, you agree to our use of cookies.