shithub: pokecrystal

Download patch

ref: ff4d25eee37c0947736258a5f9dea89072b3d7e3
parent: d6dccb7df57b4afa86483ed8c68dca605125fbdb
author: Remy Oukaour <remy.oukaour@gmail.com>
date: Thu Dec 21 07:11:35 EST 2017

Include bugfix in comments

--- a/docs/bugs_and_glitches.md
+++ b/docs/bugs_and_glitches.md
@@ -878,6 +878,8 @@
 ; making bumps silent.
 
 	ld a, [WalkingDirection]
+	; cp STANDING
+	; jr z, .not_warp
 	ld e, a
 	ld d, 0
 	ld hl, .EdgeWarps
@@ -889,6 +891,7 @@
 	ld a, 1
 	ld [wd041], a
 	ld a, [WalkingDirection]
+	; This is in the wrong place.
 	cp STANDING
 	jr z, .not_warp
 ```
@@ -1221,8 +1224,8 @@
 
 ```asm
 LoadSpriteGFX: ; 14306
-; Bug: b is not preserved, so
-; it's useless as a next count.
+; Bug: b is not preserved, so it's useless as a next count.
+; Uncomment the lines below to fix.
 
 	ld hl, UsedSprites
 	ld b, SPRITE_GFX_LIST_CAPACITY
@@ -1241,13 +1244,15 @@
 	ret
 
 .LoadSprite:
+	; push bc
 	call GetSprite
+	; pop bc
 	ld a, l
 	ret
 ; 1431e
 ```
 
-**Fix:** Surround `call GetSprite` with `push bc`/`pop bc`.
+**Fix:** Uncomment `push bc` and `pop bc`.
 
 
 ## `ChooseWildEncounter` doesn't really validate the wild Pokémon species
--- a/engine/overworld.asm
+++ b/engine/overworld.asm
@@ -389,8 +389,8 @@
 
 
 LoadSpriteGFX: ; 14306
-; Bug: b is not preserved, so
-; it's useless as a next count.
+; Bug: b is not preserved, so it's useless as a next count.
+; Uncomment the lines below to fix.
 
 	ld hl, UsedSprites
 	ld b, SPRITE_GFX_LIST_CAPACITY
@@ -409,7 +409,9 @@
 	ret
 
 .LoadSprite:
+	; push bc
 	call GetSprite
+	; pop bc
 	ld a, l
 	ret
 ; 1431e
--- a/engine/player_movement.asm
+++ b/engine/player_movement.asm
@@ -409,6 +409,8 @@
 ; making bumps silent.
 
 	ld a, [WalkingDirection]
+	; cp STANDING
+	; jr z, .not_warp
 	ld e, a
 	ld d, 0
 	ld hl, .EdgeWarps
@@ -420,6 +422,7 @@
 	ld a, 1
 	ld [wd041], a
 	ld a, [WalkingDirection]
+	; This is in the wrong place.
 	cp STANDING
 	jr z, .not_warp