Anonymous user
ItemDex/RB:093: Difference between revisions
→Bootstrapping: Aligned comments; changed "jp (hl)" to "jp hl".
>Sherkel mNo edit summary |
>Bbbbbbbbba (→Bootstrapping: Aligned comments; changed "jp (hl)" to "jp hl".) |
||
Line 39:
The bootstrap code translates to the following ASM:
; 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
$D169 <- FF ||
$D16A <- FF ||
$D16B <- 24 || inc h ; h = D3
$D16C <- 00 || nop
$D16D <-
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).
Line 69 ⟶ 68:
ASM translation:
$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
===3 Pokémon super-compressed setup===
Line 91 ⟶ 89:
ASM translation:
$D163 <- 03/04/05 || inc bc / inc b / dec b
$D164 <- C3 ||
$D165 <- 22 ||
$D166 <- D3 || jp $D322
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:
|