ItemDex/RB:093: Difference between revisions
Jump to navigation
Jump to search
Content added Content deleted
>Sherkel mNo edit summary |
>Bbbbbbbbba (→Bootstrapping: Aligned comments; changed "jp (hl)" to "jp hl".) |
||
Line 39: | Line 39: | ||
The bootstrap code translates to the following ASM: |
The bootstrap code translates to the following ASM: |
||
<code> |
|||
; 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 |
$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 <- |
$D16D <- E9 || jp hl ; pc = D322 |
||
</code> |
|||
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). |
||
Line 69: | Line 68: | ||
ASM translation: |
ASM translation: |
||
<code><br/> |
|||
$D163 <- 06 || |
$D163 <- 06 || |
||
$D164 <- ?? || ld b, ?? |
$D164 <- ?? || ld b, ?? |
||
$D165 <- 24 || inc h ; h = D2 |
$D165 <- 24 || inc h ; h = D2 |
||
$D166 <- 2E || |
$D166 <- 2E || |
||
$D167 <- 22 || ld l, 22 ; hl = D222 |
$D167 <- 22 || ld l, 22 ; hl = D222 |
||
$D168 <- 18 || |
$D168 <- 18 || |
||
$D169 <- 2D || jr 2D ; pc = D197 |
$D169 <- 2D || jr 2D ; pc = D197 |
||
(...) |
(...) |
||
$D197 <- 24 || inc h ; h = D3 |
$D197 <- 24 || inc h ; h = D3 |
||
$D198 <- 00 || nop |
$D198 <- 00 || nop |
||
$D199 <- E9 || jp |
$D199 <- E9 || jp hl ; pc = D322 |
||
</code> |
|||
===3 Pokémon super-compressed setup=== |
===3 Pokémon super-compressed setup=== |
||
Line 91: | Line 89: | ||
ASM translation: |
ASM translation: |
||
<code><br/> |
|||
$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 |
||
</code> |
|||
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: |