summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRangi <remy.oukaour+rangi42@gmail.com>2018-08-25 23:13:55 -0400
committerRangi <remy.oukaour+rangi42@gmail.com>2018-08-25 23:13:55 -0400
commit9cdbb4bb11eacb407d68c79393ae7a085092438a (patch)
treeef34b621f85b1e081052503aeb98675b07e514f4
parent82cd736affcc52c89b60db0875225ca6a7e40eb9 (diff)
ldh
-rw-r--r--Add-a-new-Unown-form.md12
-rw-r--r--Add-different-kinds-of-new-items.md4
-rw-r--r--Allow-tiles-to-have-different-attributes-in-different-blocks-(including-X-and-Y-flip).md34
-rw-r--r--Dive.md2
-rw-r--r--Don't-gain-experience-at-level-100.md10
-rw-r--r--Expand-tilesets-from-192-to-255-tiles.md14
-rw-r--r--Increase-Pokémon-sprite-animation-size.md28
-rw-r--r--Infinitely-reusable-TMs.md6
-rw-r--r--Physical-Special-split.md2
-rw-r--r--Puddles-that-splash-when-you-walk.md2
-rw-r--r--Remove-Pokémon-sprite-animations.md10
-rw-r--r--Remove-the-25%-failure-chance-for-AI-status-moves.md8
-rw-r--r--Remove-the-redundant-move-grammar-table.md2
-rw-r--r--Replace-stat-experience-with-EVs.md4
-rw-r--r--Running-Shoes.md2
15 files changed, 70 insertions, 70 deletions
diff --git a/Add-a-new-Unown-form.md b/Add-a-new-Unown-form.md
index 56ac33c..690e877 100644
--- a/Add-a-new-Unown-form.md
+++ b/Add-a-new-Unown-form.md
@@ -282,20 +282,20 @@ Edit [engine/gfx/load_pics.asm](../blob/master/engine/gfx/load_pics.asm):
-; Divide by 10 to get 0-25
+; Divide by 9 to get 0-28
- ld [hDividend + 3], a
+ ldh [hDividend + 3], a
xor a
- ld [hDividend], a
- ld [hDividend + 1], a
- ld [hDividend + 2], a
+ ldh [hDividend], a
+ ldh [hDividend + 1], a
+ ldh [hDividend + 2], a
- ld a, $ff / NUM_UNOWN + 1
+ ld a, 9
- ld [hDivisor], a
+ ldh [hDivisor], a
ld b, 4
call Divide
-; Increment to get 1-26
+; Increment to get 1-29
- ld a, [hQuotient + 2]
+ ldh a, [hQuotient + 2]
inc a
+; The valid range is 1-28, so use UNOWN_E (5) instead of 29
+ cp NUM_UNOWN + 1
diff --git a/Add-different-kinds-of-new-items.md b/Add-different-kinds-of-new-items.md
index f9cc4fd..9d4d30f 100644
--- a/Add-different-kinds-of-new-items.md
+++ b/Add-different-kinds-of-new-items.md
@@ -463,7 +463,7 @@ Now fix the effect. Edit [engine/items/item_effects.asm](../blob/master/engine/i
+ farcall _TownMap
+ call Call_ExitMenu
+ xor a
-+ ld [hBGMapMode], a
++ ldh [hBGMapMode], a
+ farcall Pack_InitGFX
+ farcall WaitBGMap_DrawPackGFX
+ farcall Pack_InitColors
@@ -507,7 +507,7 @@ Anyway, edit [engine/battle/effect_commands.asm](../blob/master/engine/battle/ef
+; get the defender's species
+ ld a, MON_SPECIES
+ call BattlePartyAttr
-+ ld a, [hBattleTurn]
++ ldh a, [hBattleTurn]
+ and a
+ ld a, [hl]
+ jr nz, .Unevolved
diff --git a/Allow-tiles-to-have-different-attributes-in-different-blocks-(including-X-and-Y-flip).md b/Allow-tiles-to-have-different-attributes-in-different-blocks-(including-X-and-Y-flip).md
index a553e92..8e7044b 100644
--- a/Allow-tiles-to-have-different-attributes-in-different-blocks-(including-X-and-Y-flip).md
+++ b/Allow-tiles-to-have-different-attributes-in-different-blocks-(including-X-and-Y-flip).md
@@ -374,7 +374,7 @@ OverworldTextModeSwitch::
+ ; fallthrough
LoadMapPart::
- ld a, [hROMBank]
+ ldh a, [hROMBank]
push af
ld a, [wTilesetBlocksBank]
@@ -550,10 +550,10 @@ Two, tile IDs in \*_metatiles.bin have their high bit masked out. That used to b
+ adc h
+ ld h, a
+
-+ ld a, [rSVBK]
++ ldh a, [rSVBK]
+ push af
+ ld a, BANK(wSurroundingAttributes)
-+ ld [rSVBK], a
++ ldh [rSVBK], a
+
+ ; copy the 4x4 metatile
+rept METATILE_WIDTH + -1
@@ -576,7 +576,7 @@ Two, tile IDs in \*_metatiles.bin have their high bit masked out. That used to b
+endr
+
+ pop af
-+ ld [rSVBK], a
++ ldh [rSVBK], a
+
+ ; Next metatile
+ pop hl
@@ -694,13 +694,13 @@ One more thing: edit [engine/overworld/load_map_part.asm](../blob/master/engine/
+
+.left_column2
+ decoord 0, 0, wAttrMap
-+ ld a, [rSVBK]
++ ldh a, [rSVBK]
+ push af
+ ld a, BANK(wSurroundingAttributes)
-+ ld [rSVBK], a
++ ldh [rSVBK], a
+ call .copy
+ pop af
-+ ld [rSVBK], a
++ ldh [rSVBK], a
+ ret
+
+.copy:
@@ -804,11 +804,11 @@ Edit [home/fade.asm](../blob/master/home/fade.asm):
-
-.okay
- ld a, [hli]
-- ld [rBGP], a
+- ldh [rBGP], a
- ld a, [hli]
-- ld [rOBP0], a
+- ldh [rOBP0], a
- ld a, [hli]
-- ld [rOBP1], a
+- ldh [rOBP1], a
- ret
```
@@ -816,7 +816,7 @@ Edit [home/lcd.asm](../blob/master/home/lcd.asm):
```diff
-Unreferenced_Function547::
-- ld a, [hLCDCPointer]
+- ldh a, [hLCDCPointer]
- cp rSCX - $ff00
- ret nz
- ld c, a
@@ -876,7 +876,7 @@ Edit [home/mobile.asm](../blob/master/home/mobile.asm):
```diff
-Unreferenced_Function3ed7::
- ld [$dc02], a
-- ld a, [hROMBank]
+- ldh a, [hROMBank]
- push af
- ld a, BANK(Function114243)
- rst Bankswitch
@@ -972,13 +972,13 @@ Edit [home/serial.asm](../blob/master/home/serial.asm):
- and a
- ret nz
- ld a, USING_INTERNAL_CLOCK
-- ld [rSB], a
+- ldh [rSB], a
- xor a
-- ld [hSerialReceive], a
+- ldh [hSerialReceive], a
- ld a, 0 << rSC_ON
-- ld [rSC], a
+- ldh [rSC], a
- ld a, 1 << rSC_ON
-- ld [rSC], a
+- ldh [rSC], a
- ret
```
@@ -1006,7 +1006,7 @@ Finally, edit [home.asm](../blob/master/home.asm):
- bit 1, a
- ret z
-
-- ld a, [hJoyDown]
+- ldh a, [hJoyDown]
- bit B_BUTTON_F, a
- ret
diff --git a/Dive.md b/Dive.md
index a150f30..aa79f65 100644
--- a/Dive.md
+++ b/Dive.md
@@ -133,7 +133,7 @@ Edit [engine/battle_anims/bg_effects.asm](../blob/master/engine/battle_anims/bg_
BGEffect_CheckFlyDigStatus:
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
add hl, bc
- ld a, [hBattleTurn]
+ ldh a, [hBattleTurn]
and $1
xor [hl]
jr nz, .player
diff --git a/Don't-gain-experience-at-level-100.md b/Don't-gain-experience-at-level-100.md
index fb0818f..8665313 100644
--- a/Don't-gain-experience-at-level-100.md
+++ b/Don't-gain-experience-at-level-100.md
@@ -43,15 +43,15 @@ Anyway, just edit one file, [engine/battle/core.asm](../blob/master/engine/battl
+ jp nc, .skip_stats
+ push bc
xor a
- ld [hMultiplicand + 0], a
- ld [hMultiplicand + 1], a
+ ldh [hMultiplicand + 0], a
+ ldh [hMultiplicand + 1], a
ld a, [wEnemyMonBaseExp]
- ld [hMultiplicand + 2], a
+ ldh [hMultiplicand + 2], a
ld a, [wEnemyMonLevel]
- ld [hMultiplier], a
+ ldh [hMultiplier], a
call Multiply
ld a, 7
- ld [hDivisor], a
+ ldh [hDivisor], a
ld b, 4
call Divide
diff --git a/Expand-tilesets-from-192-to-255-tiles.md b/Expand-tilesets-from-192-to-255-tiles.md
index 4b487fd..3ff50d2 100644
--- a/Expand-tilesets-from-192-to-255-tiles.md
+++ b/Expand-tilesets-from-192-to-255-tiles.md
@@ -182,7 +182,7 @@ Edit [engine/gfx/load_font.asm](../blob/master/engine/gfx/load_font.asm):
- ld de, Font
- ld hl, vTiles1
- lb bc, BANK(Font), 128 ; "A" to "9"
-- ld a, [rLCDC]
+- ldh a, [rLCDC]
- bit rLCDC_ENABLE, a
- jp z, Copy1bpp
-
@@ -371,17 +371,17 @@ Edit [home/map.asm](../blob/master/home/map.asm).
+ ld bc, $7f tiles
call CopyBytes
- ld a, [rVBK]
+ ldh a, [rVBK]
push af
ld a, $1
- ld [rVBK], a
+ ldh [rVBK], a
...
- ld a, [rVBK]
+ ldh a, [rVBK]
push af
ld a, $1
- ld [rVBK], a
+ ldh [rVBK], a
- ld hl, wDecompressScratch + $60 tiles
+ ld hl, wDecompressScratch + $80 tiles
@@ -391,7 +391,7 @@ Edit [home/map.asm](../blob/master/home/map.asm).
call CopyBytes
pop af
- ld [rVBK], a
+ ldh [rVBK], a
```
Now instead of loading tileset graphics into tiles $00–$5F and $80–$DF, they'll be loaded into $00–$7E and $80–$FF. That's nearly four more rows, or 63 more tiles, usable for maps. (Note that only the first $7F tiles are loaded instead of the full $80; tile $7F, is not loaded because the space character goes there.)
@@ -458,7 +458,7 @@ Edit [engine/overworld/map_objects.asm](../blob/master/engine/overworld/map_obje
```diff
Function56cd:
...
- ld a, [hUsedSpriteIndex]
+ ldh a, [hUsedSpriteIndex]
add d
dec a
cp SCREEN_WIDTH
diff --git a/Increase-Pokémon-sprite-animation-size.md b/Increase-Pokémon-sprite-animation-size.md
index c094286..a325ecd 100644
--- a/Increase-Pokémon-sprite-animation-size.md
+++ b/Increase-Pokémon-sprite-animation-size.md
@@ -95,11 +95,11 @@ Edit [engine/gfx/load_pics.asm](../blob/master/engine/gfx/load_pics.asm):
ld [wCurSpecies], a
call IsAPokemon
ret c
- ld a, [rSVBK]
+ ldh a, [rSVBK]
push af
call _GetFrontpic
pop af
- ld [rSVBK], a
+ ldh [rSVBK], a
- ret
+ jp CloseSRAM
```
@@ -110,18 +110,18 @@ Edit [engine/gfx/load_pics.asm](../blob/master/engine/gfx/load_pics.asm):
ld [wCurSpecies], a
call IsAPokemon
ret c
- ld a, [rSVBK]
+ ldh a, [rSVBK]
push af
xor a
- ld [hBGMapMode], a
+ ldh [hBGMapMode], a
call _GetFrontpic
+ ld a, BANK(vTiles3)
-+ ld [rVBK], a
++ ldh [rVBK], a
call GetAnimatedEnemyFrontpic
+ xor a
-+ ld [rVBK], a
++ ldh [rVBK], a
pop af
- ld [rSVBK], a
+ ldh [rSVBK], a
- ret
+ jp CloseSRAM
```
@@ -139,7 +139,7 @@ Edit [engine/gfx/load_pics.asm](../blob/master/engine/gfx/load_pics.asm):
call GetFrontpicPointer
- ld a, BANK(wDecompressEnemyFrontpic)
+ ld a, BANK(wDecompressScratch)
- ld [rSVBK], a
+ ldh [rSVBK], a
ld a, b
- ld de, wDecompressEnemyFrontpic
+ ld de, wDecompressScratch
@@ -162,7 +162,7 @@ Edit [engine/gfx/load_pics.asm](../blob/master/engine/gfx/load_pics.asm):
- ld de, wDecompressScratch
+ ld de, sPaddedEnemyFrontpic
ld c, 7 * 7
- ld a, [hROMBank]
+ ldh a, [hROMBank]
ld b, a
call Get2bpp
pop hl
@@ -172,12 +172,12 @@ Edit [engine/gfx/load_pics.asm](../blob/master/engine/gfx/load_pics.asm):
```diff
GetAnimatedEnemyFrontpic:
- ld a, BANK(vTiles3)
-- ld [rVBK], a
+- ldh [rVBK], a
push hl
- ld de, wDecompressScratch
+ ld de, sPaddedEnemyFrontpic
ld c, 7 * 7
- ld a, [hROMBank]
+ ldh a, [hROMBank]
ld b, a
call Get2bpp
pop hl
@@ -214,7 +214,7 @@ Edit [engine/gfx/load_pics.asm](../blob/master/engine/gfx/load_pics.asm):
pop bc
pop hl
ld de, wDecompressScratch
- ld a, [hROMBank]
+ ldh a, [hROMBank]
ld b, a
+ ; If we can load it in a single pass, just do it
+ ld a, c
@@ -226,12 +226,12 @@ Edit [engine/gfx/load_pics.asm](../blob/master/engine/gfx/load_pics.asm):
+ ld c, 127 - 7 * 7
call Get2bpp
- xor a
-- ld [rVBK], a
+- ldh [rVBK], a
- ret
+ ; ...then load the rest into vTiles4
+ ld de, wDecompressScratch + (127 - 7 * 7) tiles
+ ld hl, vTiles4
-+ ld a, [hROMBank]
++ ldh a, [hROMBank]
+ ld b, a
+ ld a, [sEnemyFrontpicTileCount]
+ ld c, a
diff --git a/Infinitely-reusable-TMs.md b/Infinitely-reusable-TMs.md
index 0acf793..7bcccdc 100644
--- a/Infinitely-reusable-TMs.md
+++ b/Infinitely-reusable-TMs.md
@@ -161,11 +161,11 @@ Edit [engine/items/mart.asm](../blob/master/engine/items/mart.asm):
+ farcall BuySell_MultiplyPrice
+ push hl
+ ld hl, hMoneyTemp
-+ ld a, [hProduct + 1]
++ ldh a, [hProduct + 1]
+ ld [hli], a
-+ ld a, [hProduct + 2]
++ ldh a, [hProduct + 2]
+ ld [hli], a
-+ ld a, [hProduct + 3]
++ ldh a, [hProduct + 3]
+ ld [hl], a
+ pop hl
+ ret
diff --git a/Physical-Special-split.md b/Physical-Special-split.md
index 69da95c..6ee4747 100644
--- a/Physical-Special-split.md
+++ b/Physical-Special-split.md
@@ -408,7 +408,7 @@ Edit [engine/pokemon/mon_menu.asm](../blob/master/engine/pokemon/mon_menu.asm) (
```diff
PlaceMoveData:
xor a
- ld [hBGMapMode], a
+ ldh [hBGMapMode], a
hlcoord 0, 10
ld de, String_MoveType_Top
call PlaceString
diff --git a/Puddles-that-splash-when-you-walk.md b/Puddles-that-splash-when-you-walk.md
index 849784a..2d81226 100644
--- a/Puddles-that-splash-when-you-walk.md
+++ b/Puddles-that-splash-when-you-walk.md
@@ -452,7 +452,7 @@ Edit [engine/overworld/movement.asm](../blob/master/engine/overworld/movement.as
.skip_grass
ld hl, wCenteredObject
- ld a, [hMapObjectIndexBuffer]
+ ldh a, [hMapObjectIndexBuffer]
cp [hl]
jr z, .player
diff --git a/Remove-Pokémon-sprite-animations.md b/Remove-Pokémon-sprite-animations.md
index 236e29f..b2e5a8e 100644
--- a/Remove-Pokémon-sprite-animations.md
+++ b/Remove-Pokémon-sprite-animations.md
@@ -145,14 +145,14 @@ Edit [engine/gfx/load_pics.asm](../blob/master/engine/gfx/load_pics.asm):
ld [wCurSpecies], a
call IsAPokemon
ret c
- ld a, [rSVBK]
+ ldh a, [rSVBK]
push af
xor a
- ld [hBGMapMode], a
+ ldh [hBGMapMode], a
call _GetFrontpic
- call GetAnimatedEnemyFrontpic
pop af
- ld [rSVBK], a
+ ldh [rSVBK], a
ret
...
@@ -276,7 +276,7 @@ Edit [engine/battle/core.asm](../blob/master/engine/battle/core.asm):
.skip_cry
call UpdateEnemyHUD
ld a, $1
- ld [hBGMapMode], a
+ ldh [hBGMapMode], a
ret
...
@@ -413,7 +413,7 @@ Finally, edit [mobile/mobile_5f.asm](../blob/master/mobile/mobile_5f.asm):
- farcall HOF_AnimateFrontpic
+ farcall HOF_PlayCry
pop af
- ld [rSVBK], a
+ ldh [rSVBK], a
call Function17e349
ret
```
diff --git a/Remove-the-25%-failure-chance-for-AI-status-moves.md b/Remove-the-25%-failure-chance-for-AI-status-moves.md
index 411ec83..00695e4 100644
--- a/Remove-the-25%-failure-chance-for-AI-status-moves.md
+++ b/Remove-the-25%-failure-chance-for-AI-status-moves.md
@@ -24,7 +24,7 @@ When the AI uses stat-lowering or status-inflicting moves, like Screech or Sleep
-.ComputerMiss:
-; Computer opponents have a 25% chance of failing.
-- ld a, [hBattleTurn]
+- ldh a, [hBattleTurn]
- and a
- jr z, .DidntMiss
-
@@ -71,7 +71,7 @@ When the AI uses stat-lowering or status-inflicting moves, like Screech or Sleep
-.CheckAIRandomFail:
- ; Enemy turn
-- ld a, [hBattleTurn]
+- ldh a, [hBattleTurn]
- and a
- jr z, .dont_fail
-
@@ -102,7 +102,7 @@ When the AI uses stat-lowering or status-inflicting moves, like Screech or Sleep
## 3. `BattleCommand_Poison`
```diff
-- ld a, [hBattleTurn]
+- ldh a, [hBattleTurn]
- and a
- jr z, .dont_sample_failure
-
@@ -131,7 +131,7 @@ When the AI uses stat-lowering or status-inflicting moves, like Screech or Sleep
```diff
.no_item_protection
-- ld a, [hBattleTurn]
+- ldh a, [hBattleTurn]
- and a
- jr z, .dont_sample_failure
-
diff --git a/Remove-the-redundant-move-grammar-table.md b/Remove-the-redundant-move-grammar-table.md
index 59b2ffc..ba87a21 100644
--- a/Remove-the-redundant-move-grammar-table.md
+++ b/Remove-the-redundant-move-grammar-table.md
@@ -77,7 +77,7 @@ Edit [engine/battle/used_move_text.asm](../blob/master/engine/battle/used_move_t
; this is a stream of text and asm from 105db9 to 105ef6
text_jump _ActorNameText
start_asm
- ld a, [hBattleTurn]
+ ldh a, [hBattleTurn]
and a
jr nz, .start
diff --git a/Replace-stat-experience-with-EVs.md b/Replace-stat-experience-with-EVs.md
index 838cd65..887cabe 100644
--- a/Replace-stat-experience-with-EVs.md
+++ b/Replace-stat-experience-with-EVs.md
@@ -345,10 +345,10 @@ Edit [engine/pokemon/move_mon.asm](../blob/master/engine/pokemon/move_mon.asm):
.loop
inc c
call CalcMonStatC
- ld a, [hMultiplicand + 1]
+ ldh a, [hMultiplicand + 1]
ld [de], a
inc de
- ld a, [hMultiplicand + 2]
+ ldh a, [hMultiplicand + 2]
ld [de], a
inc de
ld a, c
diff --git a/Running-Shoes.md b/Running-Shoes.md
index d1ab4ad..07a9bcd 100644
--- a/Running-Shoes.md
+++ b/Running-Shoes.md
@@ -40,7 +40,7 @@ This is easy to do, as discovered by [Victoria Lacroix](https://github.com/Victo
+ ld a, [wPlayerState]
+ cp PLAYER_NORMAL
+ ret nz
-+ ld a, [hJoypadDown]
++ ldh a, [hJoypadDown]
+ and B_BUTTON
+ cp B_BUTTON
+ ret