summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRangi <remy.oukaour+rangi42@gmail.com>2018-02-26 13:41:48 -0500
committerRangi <remy.oukaour+rangi42@gmail.com>2018-02-26 13:41:48 -0500
commitf0b01a4eeafe6393b55c4d1a1f6bc464590c725b (patch)
tree532dab3c4f0aa4f2eeb3860a5637f1b5eef93631
parent7df5d4f25e00236921a78b397ffc2d3b364089c4 (diff)
Document more quirks and bugs
-rw-r--r--data/maps/attributes.asm1
-rw-r--r--data/pokemon/evos_attacks.asm20
-rw-r--r--data/trainers/parties.asm14
-rw-r--r--docs/bugs_and_glitches.md34
4 files changed, 58 insertions, 11 deletions
diff --git a/data/maps/attributes.asm b/data/maps/attributes.asm
index fff261319..31532b36f 100644
--- a/data/maps/attributes.asm
+++ b/data/maps/attributes.asm
@@ -16,6 +16,7 @@ CURRENT_MAP_HEIGHT = \2_HEIGHT
db \4
ENDM
+; Connections go in order: north, south, west, east
connection: MACRO
;\1: direction
;\2: map name
diff --git a/data/pokemon/evos_attacks.asm b/data/pokemon/evos_attacks.asm
index 2649bb7a1..b57f88408 100644
--- a/data/pokemon/evos_attacks.asm
+++ b/data/pokemon/evos_attacks.asm
@@ -8,6 +8,18 @@ INCLUDE "data/pokemon/evos_attacks_pointers.asm"
EvosAttacks::
+; Evos+attacks data structure:
+; - Evolution methods:
+; * db EVOLVE_LEVEL, level, species
+; * db EVOLVE_ITEM, used item, species
+; * db EVOLVE_TRADE, held item (or -1 for none), species
+; * db EVOLVE_HAPPINESS, TR_* constant (ANYTIME, MORNDAY, NITE), species
+; * db EVOLVE_STAT, level, ATK_*_DEF constant (LT, GT, EQ), species
+; - db 0 ; no more evolutions
+; - Learnset (in increasing level order):
+; * db level, move
+; - db 0 ; no more level-up moves
+
BulbasaurEvosAttacks:
db EVOLVE_LEVEL, 16, IVYSAUR
@@ -831,7 +843,7 @@ AbraEvosAttacks:
db 0 ; no more level-up moves
KadabraEvosAttacks:
- db EVOLVE_TRADE, $ff, ALAKAZAM
+ db EVOLVE_TRADE, -1, ALAKAZAM
db 0 ; no more evolutions
db 1, TELEPORT
db 1, KINESIS
@@ -875,7 +887,7 @@ MachopEvosAttacks:
db 0 ; no more level-up moves
MachokeEvosAttacks:
- db EVOLVE_TRADE, $ff, MACHAMP
+ db EVOLVE_TRADE, -1, MACHAMP
db 0 ; no more evolutions
db 1, LOW_KICK
db 1, LEER
@@ -989,7 +1001,7 @@ GeodudeEvosAttacks:
db 0 ; no more level-up moves
GravelerEvosAttacks:
- db EVOLVE_TRADE, $ff, GOLEM
+ db EVOLVE_TRADE, -1, GOLEM
db 0 ; no more evolutions
db 1, TACKLE
db 1, DEFENSE_CURL
@@ -1248,7 +1260,7 @@ GastlyEvosAttacks:
db 0 ; no more level-up moves
HaunterEvosAttacks:
- db EVOLVE_TRADE, $ff, GENGAR
+ db EVOLVE_TRADE, -1, GENGAR
db 0 ; no more evolutions
db 1, HYPNOSIS
db 1, LICK
diff --git a/data/trainers/parties.asm b/data/trainers/parties.asm
index 805dbe38e..3c07e6597 100644
--- a/data/trainers/parties.asm
+++ b/data/trainers/parties.asm
@@ -1,12 +1,12 @@
Trainers:
; Trainer data structure:
-; db "NAME@", TRAINERTYPE_* constant
-; 1 to 6 Pokémon:
-; * for TRAINERTYPE_NORMAL: db level, species
-; * for TRAINERTYPE_ITEM: db level, species, item
-; * for TRAINERTYPE_MOVES: db level, species, 4 moves
-; * for TRAINERTYPE_ITEM_MOVES: db level, species, item, 4 moves
-; db -1 ; end
+; - db "NAME@", TRAINERTYPE_* constant
+; - 1 to 6 Pokémon:
+; * for TRAINERTYPE_NORMAL: db level, species
+; * for TRAINERTYPE_ITEM: db level, species, item
+; * for TRAINERTYPE_MOVES: db level, species, 4 moves
+; * for TRAINERTYPE_ITEM_MOVES: db level, species, item, 4 moves
+; - db -1 ; end
FalknerGroup:
diff --git a/docs/bugs_and_glitches.md b/docs/bugs_and_glitches.md
index 980c75e62..59f3e7000 100644
--- a/docs/bugs_and_glitches.md
+++ b/docs/bugs_and_glitches.md
@@ -48,6 +48,7 @@ These are known bugs and glitches in the original Pokémon Crystal game: code th
- [Using a Park Ball in normal battles has a corrupt animation](#using-a-park-ball-in-normal-battles-has-a-corrupt-animation)
- [`HELD_CATCH_CHANCE` has no effect](#held_catch_chance-has-no-effect)
- [Only the first three `EvosAttacks` evolution entries can have Stone compatibility reported correctly](#only-the-first-three-evosattacks-evolution-entries-can-have-stone-compatibility-reported-correctly)
+- [`EVOLVE_STAT` can break Stone compatibility reporting](#evolve_stat-can-break-stone-compatibility-reporting)
- [`ScriptCall` can overflow `wScriptStack` and crash](#scriptcall-can-overflow-wscriptstack-and-crash)
- [`LoadSpriteGFX` does not limit the capacity of `UsedSprites`](#loadspritegfx-does-not-limit-the-capacity-of-usedsprites)
- [`ChooseWildEncounter` doesn't really validate the wild Pokémon species](#choosewildencounter-doesnt-really-validate-the-wild-pokémon-species)
@@ -1299,6 +1300,39 @@ This is a bug with `PlacePartyMonEvoStoneCompatibility.DetermineCompatibility` i
**Fix:** Change `ld bc, 10` to `ld bc, wStringBuffer2 - wStringBuffer1` to support up to six Stone entries.
+## `EVOLVE_STAT` can break Stone compatibility reporting
+
+This is a bug with `PlacePartyMonEvoStoneCompatibility.DetermineCompatibility` in [engine/party_menu.asm](/engine/party_menu.asm):
+
+```asm
+.loop2
+ ld a, [hli]
+ and a
+ jr z, .nope
+ inc hl
+ inc hl
+ cp EVOLVE_ITEM
+ jr nz, .loop2
+```
+
+**Fix:**
+
+```asm
+.loop2
+ ld a, [hli]
+ and a
+ jr z, .nope
+ cp EVOLVE_STAT
+ jr nz, .not_four_bytes
+ inc hl
+.not_four_bytes
+ inc hl
+ inc hl
+ cp EVOLVE_ITEM
+ jr nz, .loop2
+```
+
+
## `ScriptCall` can overflow `wScriptStack` and crash
In [engine/scripting.asm](/engine/scripting.asm):