From 76ea57688e06a9f328bdd93619e532493195964f Mon Sep 17 00:00:00 2001 From: Remy Oukaour Date: Wed, 13 Dec 2017 00:28:48 -0500 Subject: Add table of contents (might remove if it's too cumbersome to maintain) --- docs/bugs_and_glitches.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'docs') diff --git a/docs/bugs_and_glitches.md b/docs/bugs_and_glitches.md index 287b0324c..3e77d5093 100644 --- a/docs/bugs_and_glitches.md +++ b/docs/bugs_and_glitches.md @@ -1,6 +1,43 @@ # Bugs and Glitches +## Contents + +- [Thick Club and Light Ball can decrease damage done with boosted (Special) Attack](#thick-club-and-light-ball-can-decrease-damage-done-with-boosted-special-attack) +- [Metal Powder can increase damage taken with boosted (Special) Defense](#metal-powder-can-increase-damage-taken-with-boosted-special-defense) +- [Belly Drum sharply boosts Attack even with under 50% HP](#belly-drum-sharply-boosts-attack-even-with-under-50-hp) +- [HP bar animation is slow for high HP](#hp-bar-animation-is-slow-for-high-hp) +- [HP bar animation off-by-one error for low HP](#hp-bar-animation-off-by-one-error-for-low-hp) +- [Experience underflow for level 1 Pokémon with Medium-Slow growth rate](#experience-underflow-for-level-1-pokémon-with-medium-slow-growth-rate) +- [Five-digit experience gain is printed incorrectly](#five-digit-experience-gain-is-printed-incorrectly) +- [NPC use of Full Heal or Full Restore does not cure Nightmare status](#npc-use-of-full-heal-or-full-restore-does-not-cure-nightmare-status) +- ["Smart" AI encourages Mean Look if its own Pokémon is badly poisoned](#smart-ai-encourages-mean-look-if-its-own-pokémon-is-badly-poisoned) +- [A Disabled, PP Up–enhanced move may not trigger automatic Struggling](#a-disabled-pp-upenhanced-move-may-not-trigger-automatic-struggling) +- [Counter and Mirror Coat still work if the opponent uses an item](#counter-and-mirror-coat-still-work-if-the-opponent-uses-an-item) +- [Present damage is incorrect in link battles](#present-damage-is-incorrect-in-link-battles) +- [BRN/PSN/PAR do not affect catch rate](#brnpsnpar-do-not-affect-catch-rate) +- [Moon Ball does not boost catch rate](#moon-ball-does-not-boost-catch-rate) +- [Love Ball boosts catch rate for the wrong gender](#love-ball-boosts-catch-rate-for-the-wrong-gender) +- [Fast Ball only boosts catch rate for three Pokémon](#fast-ball-only-boosts-catch-rate-for-three-pokémon) +- [Friend Ball catches sent to the PC overwrite the wrong Pokémon's happiness](#friend-ball-catches-sent-to-the-pc-overwrite-the-wrong-pokémons-happiness) +- [Dragon Scale, not Dragon Fang, boosts Dragon-type moves](#dragon-scale-not-dragon-fang-boosts-dragon-type-moves) +- [Daisy's massages don't always increase happiness](#daisys-massages-dont-always-increase-happiness) +- [Magikarp in Lake of Rage are shorter, not longer](#magikarp-in-lake-of-rage-are-shorter-not-longer) +- [Battle transitions fail to account for the enemy's level](#battle-transitions-fail-to-account-for-the-enemys-level) +- [No bump noise if standing on tile `$3E`](#no-bump-noise-if-standing-on-tile-3e) +- [`LoadMetatiles` wrap around past 128 blocks](#loadmetatiles-wrap-around-past-128-blocks) +- [Surfing directly across a map connection does not load the new map](#surfing-directly-across-a-map-connection-does-not-load-the-new-map) +- [`CheckOwnMon` only checks the first five letters of OT names](#checkownmon-only-checks-the-first-five-letters-of-ot-names) +- [`HELD_CATCH_CHANCE` has no effect](#held_catch_chance-has-no-effect) +- [`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) +- [`TryObjectEvent` arbitrary code execution](#tryobjectevent-arbitrary-code-execution) +- [`Special_CheckBugContestContestantFlag` can read beyond its data table](#special_checkbugcontestcontestantflag-can-read-beyond-its-data-table) +- [`ClearWRAM` only clears WRAM bank 1](#clearwram-only-clears-wram-bank-1) +- [`GetForestTreeFrame` works, but it's still bad](#getforesttreeframe-works-but-its-still-bad) + + ## Thick Club and Light Ball can decrease damage done with boosted (Special) Attack ([Video](https://www.youtube.com/watch?v=rGqu3d3pdok&t=450)) -- cgit v1.2.3 From feef75c5df98eb79f7ca26fca66d577932fd4a34 Mon Sep 17 00:00:00 2001 From: Remy Oukaour Date: Wed, 13 Dec 2017 16:46:31 -0500 Subject: Document more bugs and glitches Add a toc.py script to auto-generate tables of contents in Markdown files --- docs/bugs_and_glitches.md | 110 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 108 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/bugs_and_glitches.md b/docs/bugs_and_glitches.md index 3e77d5093..c682244e3 100644 --- a/docs/bugs_and_glitches.md +++ b/docs/bugs_and_glitches.md @@ -14,6 +14,7 @@ - ["Smart" AI encourages Mean Look if its own Pokémon is badly poisoned](#smart-ai-encourages-mean-look-if-its-own-pokémon-is-badly-poisoned) - [A Disabled, PP Up–enhanced move may not trigger automatic Struggling](#a-disabled-pp-upenhanced-move-may-not-trigger-automatic-struggling) - [Counter and Mirror Coat still work if the opponent uses an item](#counter-and-mirror-coat-still-work-if-the-opponent-uses-an-item) +- [A Pokémon that fainted from Pursuit will have its old status condition when revived](#a-pokémon-that-fainted-from-pursuit-will-have-its-old-status-condition-when-revived) - [Present damage is incorrect in link battles](#present-damage-is-incorrect-in-link-battles) - [BRN/PSN/PAR do not affect catch rate](#brnpsnpar-do-not-affect-catch-rate) - [Moon Ball does not boost catch rate](#moon-ball-does-not-boost-catch-rate) @@ -25,10 +26,15 @@ - [Magikarp in Lake of Rage are shorter, not longer](#magikarp-in-lake-of-rage-are-shorter-not-longer) - [Battle transitions fail to account for the enemy's level](#battle-transitions-fail-to-account-for-the-enemys-level) - [No bump noise if standing on tile `$3E`](#no-bump-noise-if-standing-on-tile-3e) -- [`LoadMetatiles` wrap around past 128 blocks](#loadmetatiles-wrap-around-past-128-blocks) +- [Playing Entei's Pokédex cry can distort Raikou's and Suicune's](#playing-enteis-pokédex-cry-can-distort-raikous-and-suicunes) +- [Lock-On and Mind Reader don't always bypass Fly and Dig](#lock-on-and-mind-reader-dont-always-bypass-fly-and-dig) +- [`LoadMetatiles` wraps around past 128 blocks](#loadmetatiles-wraps-around-past-128-blocks) - [Surfing directly across a map connection does not load the new map](#surfing-directly-across-a-map-connection-does-not-load-the-new-map) - [`CheckOwnMon` only checks the first five letters of OT names](#checkownmon-only-checks-the-first-five-letters-of-ot-names) +- [Catching a Transformed Pokémon always catches a Ditto](#catching-a-transformed-pokémon-always-catches-a-ditto) +- [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) - [`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) @@ -371,6 +377,13 @@ This is a bug with `CheckPlayerHasUsableMoves` in [battle/core.asm](battle/core. *To do:* Identify specific code causing this bug and fix it. +## A Pokémon that fainted from Pursuit will have its old status condition when revived + +([Video](https://www.youtube.com/watch?v=tiRvw-Nb2ME)) + +*To do:* Identify specific code causing this bug and fix it. + + ## Present damage is incorrect in link battles ([Video](https://www.youtube.com/watch?v=XJaQoKtrEuw)) @@ -720,7 +733,43 @@ This is a bug with `DoPlayerMovement.CheckWarp` in [engine/player_movement.asm]( ``` -## `LoadMetatiles` wrap around past 128 blocks +## Playing Entei's Pokédex cry can distort Raikou's and Suicune's + +([Video](https://www.youtube.com/watch?v=z305e4sIO24)) + +The exact cause is unknown, but a workaround exists for `DexEntryScreen_MenuActionJumptable.Cry` in [engine/pokedex.asm](engine/pokedex.asm): + +```asm +.Cry: ; 40340 + call Pokedex_GetSelectedMon + ld a, [wd265] + call GetCryIndex + ld e, c + ld d, b + call PlayCryHeader + ret +``` + +**Workaround:** + +```asm +.Cry: ; 40340 + ld a, [CurPartySpecies] + call PlayCry + ret +``` + + +## Lock-On and Mind Reader don't always bypass Fly and Dig + +This bug affects Attract, Curse, Foresight, Mean Look, Mimic, Nightmare, Spider Web, Transform, and stat-lowering effects of moves like String Shot or Bubble during the semi-invulnerable turn of Fly or Dig. + +*To do:* Identify specific code causing this bug and fix it. + + +## `LoadMetatiles` wraps around past 128 blocks + +This bug prevents you from using blocksets with more than 128 blocks. [home/map.asm](home/map.asm): @@ -793,6 +842,40 @@ endr **Fix:** Change `rept NAME_LENGTH_JAPANESE +- 2` to `rept PLAYER_NAME_LENGTH +- 2`. +## Catching a Transformed Pokémon always catches a Ditto + +This bug can affect Mew or Pokémon other than Ditto that used Transform via Mirror Move or Sketch. + +*To do:* Identify specific code causing this bug and fix it. + + +## Using a Park Ball in normal battles has a corrupt animation + +([Video](https://www.youtube.com/watch?v=v1ErZdLCIyU)) + +This is a bug with `ParkBall` in [items/item_effects.asm](items/item_effects.asm): + +```asm +.room_in_party + xor a + ld [wWildMon], a + ld a, [CurItem] + cp PARK_BALL + call nz, ReturnToBattle_UseBall +``` + +**Fix:** + +```asm +.room_in_party + xor a + ld [wWildMon], a + ld a, [BattleType] + cp BATTLETYPE_CONTEST + call nz, ReturnToBattle_UseBall +``` + + ## `HELD_CATCH_CHANCE` has no effect This is a bug with `PokeBall` in [items/item_effects.asm](items/item_effects.asm): @@ -817,6 +900,29 @@ This is a bug with `PokeBall` in [items/item_effects.asm](items/item_effects.asm **Fix:** Uncomment `ld b, a`. +## Only the first three `EvosAttacks` evolution entries can have Stone compatibility reported correctly + +This is a bug with `PlacePartyMonEvoStoneCompatibility.DetermineCompatibility` in [engine/party_menu.asm](engine/party_menu.asm): + +```asm +.DetermineCompatibility: ; 50268 + ld de, StringBuffer1 + ld a, BANK(EvosAttacksPointers) + ld bc, 2 + call FarCopyBytes + ld hl, StringBuffer1 + ld a, [hli] + ld h, [hl] + ld l, a + ld de, StringBuffer1 + ld a, BANK(EvosAttacks) + ld bc, $a + call FarCopyBytes +``` + +**Fix:** Change `ld bc, $a` to `ld bc, $10` to support up to five Stone entries. + + ## `ScriptCall` can overflow `wScriptStack` and crash [engine/scripting.asm](engine/scripting.asm): -- cgit v1.2.3 From 00f28bb8f4ff81b51aaf7eab7ae413218bda7843 Mon Sep 17 00:00:00 2001 From: Remy Oukaour Date: Wed, 13 Dec 2017 16:52:13 -0500 Subject: Consistent **Fix:** notation --- docs/bugs_and_glitches.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/bugs_and_glitches.md b/docs/bugs_and_glitches.md index c682244e3..4ee231d35 100644 --- a/docs/bugs_and_glitches.md +++ b/docs/bugs_and_glitches.md @@ -993,7 +993,7 @@ LoadSpriteGFX: ; 14306 ; 1431e ``` -`GetSprite` modifies `b`. Surround it with `push bc`/`pop bc` to fix. +**Fix:** Surround `call GetSprite` with `push bc`/`pop bc`. ## `ChooseWildEncounter` doesn't really validate the wild Pokémon species -- cgit v1.2.3 From b17db9b8b5939d41dbe7d35d2f5c54cf82e0c59d Mon Sep 17 00:00:00 2001 From: Remy Oukaour Date: Thu, 14 Dec 2017 14:18:33 -0500 Subject: =?UTF-8?q?Friend=20Ball=20happiness=20for=20boxed=20Pok=C3=A9mon?= =?UTF-8?q?=20is=20not=20a=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/bugs_and_glitches.md | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'docs') diff --git a/docs/bugs_and_glitches.md b/docs/bugs_and_glitches.md index 4ee231d35..8e822a54f 100644 --- a/docs/bugs_and_glitches.md +++ b/docs/bugs_and_glitches.md @@ -20,7 +20,6 @@ - [Moon Ball does not boost catch rate](#moon-ball-does-not-boost-catch-rate) - [Love Ball boosts catch rate for the wrong gender](#love-ball-boosts-catch-rate-for-the-wrong-gender) - [Fast Ball only boosts catch rate for three Pokémon](#fast-ball-only-boosts-catch-rate-for-three-pokémon) -- [Friend Ball catches sent to the PC overwrite the wrong Pokémon's happiness](#friend-ball-catches-sent-to-the-pc-overwrite-the-wrong-pokémons-happiness) - [Dragon Scale, not Dragon Fang, boosts Dragon-type moves](#dragon-scale-not-dragon-fang-boosts-dragon-type-moves) - [Daisy's massages don't always increase happiness](#daisys-massages-dont-always-increase-happiness) - [Magikarp in Lake of Rage are shorter, not longer](#magikarp-in-lake-of-rage-are-shorter-not-longer) @@ -533,23 +532,6 @@ FastBallMultiplier: **Fix:** Change `jr nz, .next` to `jr nz, .loop`. -## Friend Ball catches sent to the PC overwrite the wrong Pokémon's happiness - -This is a bug with `PokeBall` in [items/item_effects.asm](items/item_effects.asm): - -```asm - ld a, [CurItem] - cp FRIEND_BALL - jr nz, .SkipBoxMonFriendBall - ; Bug: overwrites the happiness of the first mon in the box! - ld a, FRIEND_BALL_HAPPINESS - ld [sBoxMon1Happiness], a -.SkipBoxMonFriendBall: -``` - -`sBoxMon1Happiness` is written *before* the Friend Ball Pokémon is deposited. - - ## Dragon Scale, not Dragon Fang, boosts Dragon-type moves This is a bug with `ItemAttributes` in [items/item_attributes.asm](items/item_attributes.asm): -- cgit v1.2.3 From c5d482df208bab0fe340de175b21137f56008287 Mon Sep 17 00:00:00 2001 From: Remy Oukaour Date: Thu, 14 Dec 2017 16:28:16 -0500 Subject: Document two more bugs found by Crystal_ --- docs/bugs_and_glitches.md | 339 ++++++++++++++++++++++++++++------------------ 1 file changed, 206 insertions(+), 133 deletions(-) (limited to 'docs') diff --git a/docs/bugs_and_glitches.md b/docs/bugs_and_glitches.md index 8e822a54f..0b40617aa 100644 --- a/docs/bugs_and_glitches.md +++ b/docs/bugs_and_glitches.md @@ -6,16 +6,18 @@ - [Thick Club and Light Ball can decrease damage done with boosted (Special) Attack](#thick-club-and-light-ball-can-decrease-damage-done-with-boosted-special-attack) - [Metal Powder can increase damage taken with boosted (Special) Defense](#metal-powder-can-increase-damage-taken-with-boosted-special-defense) - [Belly Drum sharply boosts Attack even with under 50% HP](#belly-drum-sharply-boosts-attack-even-with-under-50-hp) +- [Moves that lower Defense can do so after breaking a Substitute](#moves-that-lower-defense-can-do-so-after-breaking-a-substitute) +- [Counter and Mirror Coat still work if the opponent uses an item](#counter-and-mirror-coat-still-work-if-the-opponent-uses-an-item) +- [A Disabled but PP Up–enhanced move may not trigger Struggle](#a-disabled-but-pp-upenhanced-move-may-not-trigger-struggle) +- [A Pokémon that fainted from Pursuit will have its old status condition when revived](#a-pokémon-that-fainted-from-pursuit-will-have-its-old-status-condition-when-revived) +- [Beat Up can desynchronize link battles](#beat-up-can-desynchronize-link-battles) +- [Present damage is incorrect in link battles](#present-damage-is-incorrect-in-link-battles) +- ["Smart" AI encourages Mean Look if its own Pokémon is badly poisoned](#smart-ai-encourages-mean-look-if-its-own-pokémon-is-badly-poisoned) +- [NPC use of Full Heal or Full Restore does not cure Nightmare status](#npc-use-of-full-heal-or-full-restore-does-not-cure-nightmare-status) - [HP bar animation is slow for high HP](#hp-bar-animation-is-slow-for-high-hp) - [HP bar animation off-by-one error for low HP](#hp-bar-animation-off-by-one-error-for-low-hp) - [Experience underflow for level 1 Pokémon with Medium-Slow growth rate](#experience-underflow-for-level-1-pokémon-with-medium-slow-growth-rate) - [Five-digit experience gain is printed incorrectly](#five-digit-experience-gain-is-printed-incorrectly) -- [NPC use of Full Heal or Full Restore does not cure Nightmare status](#npc-use-of-full-heal-or-full-restore-does-not-cure-nightmare-status) -- ["Smart" AI encourages Mean Look if its own Pokémon is badly poisoned](#smart-ai-encourages-mean-look-if-its-own-pokémon-is-badly-poisoned) -- [A Disabled, PP Up–enhanced move may not trigger automatic Struggling](#a-disabled-pp-upenhanced-move-may-not-trigger-automatic-struggling) -- [Counter and Mirror Coat still work if the opponent uses an item](#counter-and-mirror-coat-still-work-if-the-opponent-uses-an-item) -- [A Pokémon that fainted from Pursuit will have its old status condition when revived](#a-pokémon-that-fainted-from-pursuit-will-have-its-old-status-condition-when-revived) -- [Present damage is incorrect in link battles](#present-damage-is-incorrect-in-link-battles) - [BRN/PSN/PAR do not affect catch rate](#brnpsnpar-do-not-affect-catch-rate) - [Moon Ball does not boost catch rate](#moon-ball-does-not-boost-catch-rate) - [Love Ball boosts catch rate for the wrong gender](#love-ball-boosts-catch-rate-for-the-wrong-gender) @@ -171,6 +173,204 @@ BattleCommand_BellyDrum: ; 37c1a ``` +## Moves that lower Defense can do so after breaking a Substitute + +([Video](https://www.youtube.com/watch?v=OGwKPRJLaaI)) + +This bug affects Acid, Iron Tail, and Rock Smash. + +This is a bug with `DefenseDownHit` in [battle/moves/move_effects.asm](battle/moves/move_effects.asm): + +```asm +DefenseDownHit: + checkobedience + usedmovetext + doturn + critical + damagestats + damagecalc + stab + damagevariation + checkhit + effectchance + hittarget + failuretext + checkfaint + criticaltext + supereffectivetext + checkdestinybond + buildopponentrage + effectchance ; bug: duplicate effectchance shouldn't be here + defensedown + statdownmessage + endmove +``` + +**Fix:** Delete the second `effectchance`. + + +## Counter and Mirror Coat still work if the opponent uses an item + +([Video](https://www.youtube.com/watch?v=uRYyzKRatFk)) + +*To do:* Identify specific code causing this bug and fix it. + + +## A Disabled but PP Up–enhanced move may not trigger Struggle + +([Video](https://www.youtube.com/watch?v=1v9x4SgMggs)) + +This is a bug with `CheckPlayerHasUsableMoves` in [battle/core.asm](battle/core.asm): + +```asm +.done + ; Bug: this will result in a move with PP Up confusing the game. + ; Replace with "and $3f" to fix. + and a + ret nz + +.force_struggle + ld hl, BattleText_PkmnHasNoMovesLeft + call StdBattleTextBox + ld c, 60 + call DelayFrames + xor a + ret +``` + +**Fix:** Change `and a` to `and $3f`. + + +## A Pokémon that fainted from Pursuit will have its old status condition when revived + +([Video](https://www.youtube.com/watch?v=tiRvw-Nb2ME)) + +*To do:* Identify specific code causing this bug and fix it. + + +## Beat Up can desynchronize link battles + +([Video](https://www.youtube.com/watch?v=202-iAsrIa8)) + +This is a bug with `BattleCommand_BeatUp` in [battle/effect_commands.asm](battle/effect_commands.asm): + +```asm +.got_mon + ld a, [wd002] + ld hl, PartyMonNicknames + call GetNick + ld a, MON_HP + call GetBeatupMonLocation + ld a, [hli] + or [hl] + jp z, .beatup_fail ; fainted + ld a, [wd002] + ld c, a + ld a, [CurBattleMon] + ; BUG: this can desynchronize link battles + ; Change "cp [hl]" to "cp c" to fix + cp [hl] + ld hl, BattleMonStatus + jr z, .active_mon + ld a, MON_STATUS + call GetBeatupMonLocation +.active_mon + ld a, [hl] + and a + jp nz, .beatup_fail +``` + +**Fix:** Change `cp [hl]` to `cp c`. + + +## Present damage is incorrect in link battles + +([Video](https://www.youtube.com/watch?v=XJaQoKtrEuw)) + +This bug existed for all battles in Gold and Silver, and was only fixed for single-player battles in Crystal to preserve link compatibility. + +This is a bug with `BattleCommand_Present` in [battle/effects/present.asm](battle/effects/present.asm): + +```asm +BattleCommand_Present: ; 37874 +; present + + ld a, [wLinkMode] + cp LINK_COLOSSEUM + jr z, .colosseum_skippush + push bc + push de +.colosseum_skippush + + call BattleCommand_Stab + + ld a, [wLinkMode] + cp LINK_COLOSSEUM + jr z, .colosseum_skippop + pop de + pop bc +.colosseum_skippop +``` + +**Fix:** + +```asm +BattleCommand_Present: ; 37874 +; present + + push bc + push de + call BattleCommand_Stab + pop de + pop bc +``` + + +## "Smart" AI encourages Mean Look if its own Pokémon is badly poisoned + +([Video](https://www.youtube.com/watch?v=cygMO-zHTls)) + +This is a bug with `AI_Smart_MeanLook` in [battle/ai/scoring.asm](battle/ai/scoring.asm): + +```asm +; 80% chance to greatly encourage this move if the enemy is badly poisoned (buggy). +; Should check PlayerSubStatus5 instead. + ld a, [EnemySubStatus5] + bit SUBSTATUS_TOXIC, a + jr nz, .asm_38e26 +``` + +**Fix:** Change `EnemySubStatus5` to `PlayerSubStatus5`. + + +## NPC use of Full Heal or Full Restore does not cure Nightmare status + +([Video](https://www.youtube.com/watch?v=rGqu3d3pdok&t=322)) + +This is a bug with `AI_HealStatus` in [battle/ai/items.asm](battle/ai/items.asm): + +```asm +AI_HealStatus: ; 384e0 + ld a, [CurOTMon] + ld hl, OTPartyMon1Status + ld bc, PARTYMON_STRUCT_LENGTH + call AddNTimes + xor a + ld [hl], a + ld [EnemyMonStatus], a + ; Bug: this should reset SUBSTATUS_NIGHTMARE too + ; Uncomment the lines below to fix + ; ld hl, EnemySubStatus1 + ; res SUBSTATUS_NIGHTMARE, [hl] + ld hl, EnemySubStatus5 + res SUBSTATUS_TOXIC, [hl] + ret +; 384f7 +``` + +**Fix:** Uncomment `ld hl, EnemySubStatus1` and `res SUBSTATUS_NIGHTMARE, [hl]`. + + ## HP bar animation is slow for high HP ([Video](https://www.youtube.com/watch?v=SE-BfsFgZVM)) @@ -299,133 +499,6 @@ Text_StringBuffer2ExpPoints:: **Fix:** Change both `deciram StringBuffer2, 2, 4` to `deciram StringBuffer2, 2, 5`. -## NPC use of Full Heal or Full Restore does not cure Nightmare status - -([Video](https://www.youtube.com/watch?v=rGqu3d3pdok&t=322)) - -This is a bug with `AI_HealStatus` in [battle/ai/items.asm](battle/ai/items.asm): - -```asm -AI_HealStatus: ; 384e0 - ld a, [CurOTMon] - ld hl, OTPartyMon1Status - ld bc, PARTYMON_STRUCT_LENGTH - call AddNTimes - xor a - ld [hl], a - ld [EnemyMonStatus], a - ; Bug: this should reset SUBSTATUS_NIGHTMARE too - ; Uncomment the lines below to fix - ; ld hl, EnemySubStatus1 - ; res SUBSTATUS_NIGHTMARE, [hl] - ld hl, EnemySubStatus5 - res SUBSTATUS_TOXIC, [hl] - ret -; 384f7 -``` - -**Fix:** Uncomment `ld hl, EnemySubStatus1` and `res SUBSTATUS_NIGHTMARE, [hl]`. - - -## "Smart" AI encourages Mean Look if its own Pokémon is badly poisoned - -([Video](https://www.youtube.com/watch?v=cygMO-zHTls)) - -This is a bug with `AI_Smart_MeanLook` in [battle/ai/scoring.asm](battle/ai/scoring.asm): - -```asm -; 80% chance to greatly encourage this move if the enemy is badly poisoned (buggy). -; Should check PlayerSubStatus5 instead. - ld a, [EnemySubStatus5] - bit SUBSTATUS_TOXIC, a - jr nz, .asm_38e26 -``` - -**Fix:** Change `EnemySubStatus5` to `PlayerSubStatus5`. - - -## A Disabled, PP Up–enhanced move may not trigger automatic Struggling - -([Video](https://www.youtube.com/watch?v=1v9x4SgMggs)) - -This is a bug with `CheckPlayerHasUsableMoves` in [battle/core.asm](battle/core.asm): - -```asm -.done - ; Bug: this will result in a move with PP Up confusing the game. - ; Replace with "and $3f" to fix. - and a - ret nz - -.force_struggle - ld hl, BattleText_PkmnHasNoMovesLeft - call StdBattleTextBox - ld c, 60 - call DelayFrames - xor a - ret -``` - -**Fix:** Change `and a` to `and $3f`. - - -## Counter and Mirror Coat still work if the opponent uses an item - -([Video](https://www.youtube.com/watch?v=uRYyzKRatFk)) - -*To do:* Identify specific code causing this bug and fix it. - - -## A Pokémon that fainted from Pursuit will have its old status condition when revived - -([Video](https://www.youtube.com/watch?v=tiRvw-Nb2ME)) - -*To do:* Identify specific code causing this bug and fix it. - - -## Present damage is incorrect in link battles - -([Video](https://www.youtube.com/watch?v=XJaQoKtrEuw)) - -This bug existed for all battles in Gold and Silver, and was only fixed for single-player battles in Crystal to preserve link compatibility. - -This is a bug with `BattleCommand_Present` in [battle/effects/present.asm](battle/effects/present.asm): - -```asm -BattleCommand_Present: ; 37874 -; present - - ld a, [wLinkMode] - cp LINK_COLOSSEUM - jr z, .colosseum_skippush - push bc - push de -.colosseum_skippush - - call BattleCommand_Stab - - ld a, [wLinkMode] - cp LINK_COLOSSEUM - jr z, .colosseum_skippop - pop de - pop bc -.colosseum_skippop -``` - -**Fix:** - -```asm -BattleCommand_Present: ; 37874 -; present - - push bc - push de - call BattleCommand_Stab - pop de - pop bc -``` - - ## BRN/PSN/PAR do not affect catch rate This is a bug with `PokeBall` in [items/item_effects.asm](items/item_effects.asm): -- cgit v1.2.3 From 68785d999668f9a6777c58c67712987392a8d675 Mon Sep 17 00:00:00 2001 From: Remy Oukaour Date: Thu, 14 Dec 2017 19:04:44 -0500 Subject: Use absolute links within repository --- docs/bugs_and_glitches.md | 70 +++++++++++++++++++++++----------------------- docs/event_commands.md | 3 ++ docs/move_anim_commands.md | 3 ++ docs/movement_commands.md | 3 ++ docs/music_commands.md | 3 ++ docs/pic_animations.md | 3 ++ docs/text_commands.md | 32 +++++++++++++++++++++ 7 files changed, 82 insertions(+), 35 deletions(-) (limited to 'docs') diff --git a/docs/bugs_and_glitches.md b/docs/bugs_and_glitches.md index 0b40617aa..961e0d9ff 100644 --- a/docs/bugs_and_glitches.md +++ b/docs/bugs_and_glitches.md @@ -49,7 +49,7 @@ ([Video](https://www.youtube.com/watch?v=rGqu3d3pdok&t=450)) -This is a bug with `SpeciesItemBoost` in [battle/effect_commands.asm](battle/effect_commands.asm): +This is a bug with `SpeciesItemBoost` in [battle/effect_commands.asm](/battle/effect_commands.asm): ```asm ; Double the stat @@ -83,7 +83,7 @@ This is a bug with `SpeciesItemBoost` in [battle/effect_commands.asm](battle/eff ([Video](https://www.youtube.com/watch?v=rGqu3d3pdok&t=450)) -This is a bug with `DittoMetalPowder` in [battle/effect_commands.asm](battle/effect_commands.asm): +This is a bug with `DittoMetalPowder` in [battle/effect_commands.asm](/battle/effect_commands.asm): ```asm ld a, c @@ -139,7 +139,7 @@ This is a bug with `DittoMetalPowder` in [battle/effect_commands.asm](battle/eff ([Video](https://www.youtube.com/watch?v=zuCLMikWo4Y)) -This is a bug with `BattleCommand_BellyDrum` in [battle/effect_commands.asm](battle/effect_commands.asm): +This is a bug with `BattleCommand_BellyDrum` in [battle/effect_commands.asm](/battle/effect_commands.asm): ```asm BattleCommand_BellyDrum: ; 37c1a @@ -179,7 +179,7 @@ BattleCommand_BellyDrum: ; 37c1a This bug affects Acid, Iron Tail, and Rock Smash. -This is a bug with `DefenseDownHit` in [battle/moves/move_effects.asm](battle/moves/move_effects.asm): +This is a bug with `DefenseDownHit` in [battle/moves/move_effects.asm](/battle/moves/move_effects.asm): ```asm DefenseDownHit: @@ -220,7 +220,7 @@ DefenseDownHit: ([Video](https://www.youtube.com/watch?v=1v9x4SgMggs)) -This is a bug with `CheckPlayerHasUsableMoves` in [battle/core.asm](battle/core.asm): +This is a bug with `CheckPlayerHasUsableMoves` in [battle/core.asm](/battle/core.asm): ```asm .done @@ -252,7 +252,7 @@ This is a bug with `CheckPlayerHasUsableMoves` in [battle/core.asm](battle/core. ([Video](https://www.youtube.com/watch?v=202-iAsrIa8)) -This is a bug with `BattleCommand_BeatUp` in [battle/effect_commands.asm](battle/effect_commands.asm): +This is a bug with `BattleCommand_BeatUp` in [battle/effect_commands.asm](/battle/effect_commands.asm): ```asm .got_mon @@ -289,7 +289,7 @@ This is a bug with `BattleCommand_BeatUp` in [battle/effect_commands.asm](battle This bug existed for all battles in Gold and Silver, and was only fixed for single-player battles in Crystal to preserve link compatibility. -This is a bug with `BattleCommand_Present` in [battle/effects/present.asm](battle/effects/present.asm): +This is a bug with `BattleCommand_Present` in [battle/effects/present.asm](/battle/effects/present.asm): ```asm BattleCommand_Present: ; 37874 @@ -330,7 +330,7 @@ BattleCommand_Present: ; 37874 ([Video](https://www.youtube.com/watch?v=cygMO-zHTls)) -This is a bug with `AI_Smart_MeanLook` in [battle/ai/scoring.asm](battle/ai/scoring.asm): +This is a bug with `AI_Smart_MeanLook` in [battle/ai/scoring.asm](/battle/ai/scoring.asm): ```asm ; 80% chance to greatly encourage this move if the enemy is badly poisoned (buggy). @@ -347,7 +347,7 @@ This is a bug with `AI_Smart_MeanLook` in [battle/ai/scoring.asm](battle/ai/scor ([Video](https://www.youtube.com/watch?v=rGqu3d3pdok&t=322)) -This is a bug with `AI_HealStatus` in [battle/ai/items.asm](battle/ai/items.asm): +This is a bug with `AI_HealStatus` in [battle/ai/items.asm](/battle/ai/items.asm): ```asm AI_HealStatus: ; 384e0 @@ -375,7 +375,7 @@ AI_HealStatus: ; 384e0 ([Video](https://www.youtube.com/watch?v=SE-BfsFgZVM)) -This is a bug with `LongAnim_UpdateVariables` in [engine/anim_hp_bar.asm](engine/anim_hp_bar.asm): +This is a bug with `LongAnim_UpdateVariables` in [engine/anim_hp_bar.asm](/engine/anim_hp_bar.asm): ```asm ; This routine is buggy. The result from ComputeHPBarPixels is stored @@ -403,7 +403,7 @@ This is a bug with `LongAnim_UpdateVariables` in [engine/anim_hp_bar.asm](engine ([Video](https://www.youtube.com/watch?v=9KyNVIZxJvI)) -This is a bug with `ShortHPBar_CalcPixelFrame` in [engine/anim_hp_bar.asm](engine/anim_hp_bar.asm): +This is a bug with `ShortHPBar_CalcPixelFrame` in [engine/anim_hp_bar.asm](/engine/anim_hp_bar.asm): ```asm ld b, 0 @@ -431,7 +431,7 @@ This is a bug with `ShortHPBar_CalcPixelFrame` in [engine/anim_hp_bar.asm](engin This can bring Pokémon straight from level 1 to 100 by gaining just a few experience points. -This is a bug with `CalcExpAtLevel` in [main.asm](main.asm): +This is a bug with `CalcExpAtLevel` in [main.asm](/main.asm): ```asm CalcExpAtLevel: ; 50e47 @@ -477,7 +477,7 @@ CalcExpAtLevel: ; 50e47 ([Video](https://www.youtube.com/watch?v=o54VjpAEoO8)) -This is a bug with `Text_ABoostedStringBuffer2ExpPoints` and `Text_StringBuffer2ExpPoints` in [text/common_2.asm](text/common_2.asm): +This is a bug with `Text_ABoostedStringBuffer2ExpPoints` and `Text_StringBuffer2ExpPoints` in [text/common_2.asm](/text/common_2.asm): ```asm Text_ABoostedStringBuffer2ExpPoints:: @@ -501,7 +501,7 @@ Text_StringBuffer2ExpPoints:: ## BRN/PSN/PAR do not affect catch rate -This is a bug with `PokeBall` in [items/item_effects.asm](items/item_effects.asm): +This is a bug with `PokeBall` in [items/item_effects.asm](/items/item_effects.asm): ```asm .statuscheck @@ -533,7 +533,7 @@ This is a bug with `PokeBall` in [items/item_effects.asm](items/item_effects.asm ## Moon Ball does not boost catch rate -This is a bug with `MoonBallMultiplier` in [items/item_effects.asm](items/item_effects.asm): +This is a bug with `MoonBallMultiplier` in [items/item_effects.asm](/items/item_effects.asm): ```asm MoonBallMultiplier: @@ -559,7 +559,7 @@ MoonBallMultiplier: ## Love Ball boosts catch rate for the wrong gender -This is a bug with `LoveBallMultiplier` in [items/item_effects.asm](items/item_effects.asm): +This is a bug with `LoveBallMultiplier` in [items/item_effects.asm](/items/item_effects.asm): ```asm LoveBallMultiplier: @@ -581,7 +581,7 @@ LoveBallMultiplier: ## Fast Ball only boosts catch rate for three Pokémon -This is a bug with `FastBallMultiplier` in [items/item_effects.asm](items/item_effects.asm): +This is a bug with `FastBallMultiplier` in [items/item_effects.asm](/items/item_effects.asm): ```asm FastBallMultiplier: @@ -607,7 +607,7 @@ FastBallMultiplier: ## Dragon Scale, not Dragon Fang, boosts Dragon-type moves -This is a bug with `ItemAttributes` in [items/item_attributes.asm](items/item_attributes.asm): +This is a bug with `ItemAttributes` in [items/item_attributes.asm](/items/item_attributes.asm): ```asm ; DRAGON FANG @@ -624,7 +624,7 @@ This is a bug with `ItemAttributes` in [items/item_attributes.asm](items/item_at ## Daisy's massages don't always increase happiness -This is a bug with `MassageOrHaircut` in [event/special.asm](event/special.asm): +This is a bug with `MassageOrHaircut` in [event/special.asm](/event/special.asm): ```asm ; Bug: Subtracting $ff from $ff fails to set c. @@ -673,7 +673,7 @@ Data_DaisyMassage: ; 746b ## Magikarp in Lake of Rage are shorter, not longer -This is a bug with `LoadEnemyMon.CheckMagikarpArea` in [battle/core.asm](battle/core.asm): +This is a bug with `LoadEnemyMon.CheckMagikarpArea` in [battle/core.asm](/battle/core.asm): ```asm .CheckMagikarpArea: @@ -701,7 +701,7 @@ This is a bug with `LoadEnemyMon.CheckMagikarpArea` in [battle/core.asm](battle/ ([Video](https://www.youtube.com/watch?v=eij_1060SMc)) -This is a bug with `StartTrainerBattle_DetermineWhichAnimation` in [engine/battle_start.asm](engine/battle_start.asm): +This is a bug with `StartTrainerBattle_DetermineWhichAnimation` in [engine/battle_start.asm](/engine/battle_start.asm): ```asm StartTrainerBattle_DetermineWhichAnimation: ; 8c365 (23:4365) @@ -744,7 +744,7 @@ StartTrainerBattle_DetermineWhichAnimation: ; 8c365 (23:4365) ## No bump noise if standing on tile `$3E` -This is a bug with `DoPlayerMovement.CheckWarp` in [engine/player_movement.asm](engine/player_movement.asm): +This is a bug with `DoPlayerMovement.CheckWarp` in [engine/player_movement.asm](/engine/player_movement.asm): ```asm ; Bug: Since no case is made for STANDING here, it will check @@ -792,7 +792,7 @@ This is a bug with `DoPlayerMovement.CheckWarp` in [engine/player_movement.asm]( ([Video](https://www.youtube.com/watch?v=z305e4sIO24)) -The exact cause is unknown, but a workaround exists for `DexEntryScreen_MenuActionJumptable.Cry` in [engine/pokedex.asm](engine/pokedex.asm): +The exact cause is unknown, but a workaround exists for `DexEntryScreen_MenuActionJumptable.Cry` in [engine/pokedex.asm](/engine/pokedex.asm): ```asm .Cry: ; 40340 @@ -826,7 +826,7 @@ This bug affects Attract, Curse, Foresight, Mean Look, Mimic, Nightmare, Spider This bug prevents you from using blocksets with more than 128 blocks. -[home/map.asm](home/map.asm): +[home/map.asm](/home/map.asm): ```asm ; Set hl to the address of the current metatile data ([TilesetBlocksAddress] + (a) tiles). @@ -863,7 +863,7 @@ This bug prevents you from using blocksets with more than 128 blocks. This bug can allow you to talk to Eusine in Celadon City and encounter Ho-Oh with only traded legendary beasts. -[engine/search.asm](engine/search.asm): +[engine/search.asm](/engine/search.asm): ```asm ; check OT @@ -908,7 +908,7 @@ This bug can affect Mew or Pokémon other than Ditto that used Transform via Mir ([Video](https://www.youtube.com/watch?v=v1ErZdLCIyU)) -This is a bug with `ParkBall` in [items/item_effects.asm](items/item_effects.asm): +This is a bug with `ParkBall` in [items/item_effects.asm](/items/item_effects.asm): ```asm .room_in_party @@ -933,7 +933,7 @@ This is a bug with `ParkBall` in [items/item_effects.asm](items/item_effects.asm ## `HELD_CATCH_CHANCE` has no effect -This is a bug with `PokeBall` in [items/item_effects.asm](items/item_effects.asm): +This is a bug with `PokeBall` in [items/item_effects.asm](/items/item_effects.asm): ```asm ; BUG: callba overwrites a, @@ -957,7 +957,7 @@ This is a bug with `PokeBall` in [items/item_effects.asm](items/item_effects.asm ## Only the first three `EvosAttacks` evolution entries can have Stone compatibility reported correctly -This is a bug with `PlacePartyMonEvoStoneCompatibility.DetermineCompatibility` in [engine/party_menu.asm](engine/party_menu.asm): +This is a bug with `PlacePartyMonEvoStoneCompatibility.DetermineCompatibility` in [engine/party_menu.asm](/engine/party_menu.asm): ```asm .DetermineCompatibility: ; 50268 @@ -980,7 +980,7 @@ This is a bug with `PlacePartyMonEvoStoneCompatibility.DetermineCompatibility` i ## `ScriptCall` can overflow `wScriptStack` and crash -[engine/scripting.asm](engine/scripting.asm): +[engine/scripting.asm](/engine/scripting.asm): ```asm ScriptCall: @@ -1018,7 +1018,7 @@ ScriptCall: ## `LoadSpriteGFX` does not limit the capacity of `UsedSprites` -[engine/overworld.asm](engine/overworld.asm): +[engine/overworld.asm](/engine/overworld.asm): ```asm LoadSpriteGFX: ; 14306 @@ -1053,7 +1053,7 @@ LoadSpriteGFX: ; 14306 ## `ChooseWildEncounter` doesn't really validate the wild Pokémon species -[engine/wildmons.asm](engine/wildmons.asm): +[engine/wildmons.asm](/engine/wildmons.asm): ```asm ChooseWildEncounter: ; 2a14f @@ -1092,7 +1092,7 @@ ValidateTempWildMonSpecies: ; 2a4a0 ## `TryObjectEvent` arbitrary code execution -[engine/events.asm](engine/events.asm): +[engine/events.asm](/engine/events.asm): ```asm ; Bug: If IsInArray returns nc, data at bc will be executed as code. @@ -1120,7 +1120,7 @@ ValidateTempWildMonSpecies: ; 2a4a0 ## `Special_CheckBugContestContestantFlag` can read beyond its data table -[event/bug_contest_2.asm](event/bug_contest_2.asm): +[event/bug_contest_2.asm](/event/bug_contest_2.asm): ```asm Special_CheckBugContestContestantFlag: ; 139ed @@ -1158,7 +1158,7 @@ BugCatchingContestantEventFlagTable: ; 139fe ## `ClearWRAM` only clears WRAM bank 1 -[home/init.asm](home/init.asm): +[home/init.asm](/home/init.asm): ```asm ClearWRAM:: ; 25a @@ -1186,7 +1186,7 @@ ClearWRAM:: ; 25a ## `GetForestTreeFrame` works, but it's still bad -[tilesets/animations.asm](tilesets/animations.asm): +[tilesets/animations.asm](/tilesets/animations.asm): ```asm GetForestTreeFrame: ; fc54c diff --git a/docs/event_commands.md b/docs/event_commands.md index 662159481..b9bc4a925 100644 --- a/docs/event_commands.md +++ b/docs/event_commands.md @@ -1,5 +1,8 @@ # Event Commands +Defined in [macros/scripts/event.asm](/macros/scripts/event.asm) and [engine/scripting.asm:ScriptCommandTable](/engine/scripting.asm). + + ## `$00`: `scall` *script* ## `$01`: `farscall` *script* diff --git a/docs/move_anim_commands.md b/docs/move_anim_commands.md index 5669187f7..9772550c3 100644 --- a/docs/move_anim_commands.md +++ b/docs/move_anim_commands.md @@ -1,5 +1,8 @@ # Move Animation Commands +Defined in [macros/scripts/move_anim.asm](/macros/scripts/move_anim.asm) and [battle/anims.asm:BattleAnimations](/battle/anims.asm). + + ## `$00`−`$EF`: `anim_wait` *length* ## `$D0`: `anim_obj` *object*, *x*, *y*, *param* diff --git a/docs/movement_commands.md b/docs/movement_commands.md index 702bd1f6c..db86fd2f9 100644 --- a/docs/movement_commands.md +++ b/docs/movement_commands.md @@ -1,5 +1,8 @@ # Movement Commands +Defined in [macros/scripts/movement.asm](/macros/scripts/movement.asm) and [engine/movement.asm:MovementPointers](/engine/movement.asm). + + ## `$00`−`$03`: `turn_head` *direction* ## `$04`−`$07`: `turn_step` *direction* diff --git a/docs/music_commands.md b/docs/music_commands.md index 564ac010a..bf6359068 100644 --- a/docs/music_commands.md +++ b/docs/music_commands.md @@ -1,5 +1,8 @@ # Music Commands +Defined in [macros/scripts/audio.asm](/macros/scripts/audio.asm) and [audio/engine.asm:MusicCommands](/audio/engine.asm). + + ## `musicheader` *n*, *index*, *address* ## `cry_header` *n*, *index*, *address* diff --git a/docs/pic_animations.md b/docs/pic_animations.md index a87932819..57c7f151a 100644 --- a/docs/pic_animations.md +++ b/docs/pic_animations.md @@ -1,5 +1,8 @@ # Pic Animations +Defined in [macros/scripts/gfx_anim.asm](/macros/scripts/gfx_anim.asm) and [battle/anim_commands.asm:BattleAnimCommands](/battle/anim_commands.asm). + + Pic animations are assembled in 3 parts: - Top-level animations: diff --git a/docs/text_commands.md b/docs/text_commands.md index 865ea69b5..cf3a53327 100644 --- a/docs/text_commands.md +++ b/docs/text_commands.md @@ -1,116 +1,146 @@ # Text Commands +Defined in [macros/scripts/text.asm](/macros/scripts/text.asm) and [home/text.asm:TextCommands](/home/text.asm). + + ## `$00`: `text` *text* Start writing text until `"@"`. + ## `$4E`: `next` *text* Move a line down. + ## `$4F`: `line` *text* Start writing at the bottom line. + ## `$50`: `page` *text* Start a new Pokédex page. + ## `$51`: `para` *text* Start a new paragraph. + ## `$55`: `cont` *text* Scroll to the next line. + ## `$57`: `done` End a text box. + ## `$58`: `prompt` Prompt the player to end a text box (initiating some other event). + ## `$01`: `text_from_ram` *address* Write text from a RAM address. + ## `$02`: `text_bcd` *address*, *flags* Write [BCD](bcd) from an address, typically RAM. [bcd]: https://en.wikipedia.org/wiki/Binary-coded_decimal + ## `$03`: `text_move` *address* Move to a new tile. + ## `$04`: `text_box` *address*, *height*, *width* Draw a box. + ## `$05`: `text_low` Write text at (1, 16). + ## `$06`: `text_waitbutton` Wait for button press; show arrow. + ## `$07`: `text_scroll` Pushes text up two lines and sets the `bc` cursor to the border tile below the first character column of the text box. + ## `$08`: `start_asm` Start interpreting assembly code. + ## `$09`: `deciram` *address*, *bytes*, *digits* Read *bytes* bytes from *address* and print them as a *digits*-digit number. + ## `$0A`: `interpret_data` Exit. + ## `$0B`: `sound_dex_fanfare_50_79` Play `SFX_DEX_FANFARE_50_79`. + ## `$0C`: `limited_interpret_data` *number* Print *number* `"…"`s. + ## `$0D`: `link_wait_button` Wait for button press; show arrow. + ## `$0E`: `sound_dex_fanfare_20_49` Play `SFX_DEX_FANFARE_20_49`. + ## `$0F`: `sound_item` Play `SFX_ITEM`. + ## `$10`: `sound_caught_mon` Play `SFX_CAUGHT_MON`. + ## `$11`: `sound_dex_fanfare_80_109` Play `SFX_DEX_FANFARE_80_109`. + ## `$12`: `sound_fanfare` Play `SFX_FANFARE`. + ## `$13`: `sound_slot_machine_start` Play `SFX_SLOT_MACHINE_START`. + ## `$14`: `text_buffer` *id* Write text from one of the following addresses (listed in `StringBufferPointers`): @@ -123,10 +153,12 @@ Write text from one of the following addresses (listed in `StringBufferPointers` 5. `EnemyMonNick` 6. `BattleMonNick` + ## `$15`: `current_day` Print the weekday. + ## `$16`: `text_jump` *address* Write text from a different bank. -- cgit v1.2.3 From 232feca298695c950ade1fc753ee7639522696ce Mon Sep 17 00:00:00 2001 From: Remy Oukaour Date: Thu, 14 Dec 2017 19:07:06 -0500 Subject: Consistent "(with ) in " phrasing --- docs/bugs_and_glitches.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'docs') diff --git a/docs/bugs_and_glitches.md b/docs/bugs_and_glitches.md index 961e0d9ff..9ed7a9ee8 100644 --- a/docs/bugs_and_glitches.md +++ b/docs/bugs_and_glitches.md @@ -826,7 +826,7 @@ This bug affects Attract, Curse, Foresight, Mean Look, Mimic, Nightmare, Spider This bug prevents you from using blocksets with more than 128 blocks. -[home/map.asm](/home/map.asm): +In [home/map.asm](/home/map.asm): ```asm ; Set hl to the address of the current metatile data ([TilesetBlocksAddress] + (a) tiles). @@ -863,7 +863,7 @@ This bug prevents you from using blocksets with more than 128 blocks. This bug can allow you to talk to Eusine in Celadon City and encounter Ho-Oh with only traded legendary beasts. -[engine/search.asm](/engine/search.asm): +In [engine/search.asm](/engine/search.asm): ```asm ; check OT @@ -980,7 +980,7 @@ This is a bug with `PlacePartyMonEvoStoneCompatibility.DetermineCompatibility` i ## `ScriptCall` can overflow `wScriptStack` and crash -[engine/scripting.asm](/engine/scripting.asm): +In [engine/scripting.asm](/engine/scripting.asm): ```asm ScriptCall: @@ -1018,7 +1018,7 @@ ScriptCall: ## `LoadSpriteGFX` does not limit the capacity of `UsedSprites` -[engine/overworld.asm](/engine/overworld.asm): +In [engine/overworld.asm](/engine/overworld.asm): ```asm LoadSpriteGFX: ; 14306 @@ -1053,7 +1053,7 @@ LoadSpriteGFX: ; 14306 ## `ChooseWildEncounter` doesn't really validate the wild Pokémon species -[engine/wildmons.asm](/engine/wildmons.asm): +In [engine/wildmons.asm](/engine/wildmons.asm): ```asm ChooseWildEncounter: ; 2a14f @@ -1092,7 +1092,7 @@ ValidateTempWildMonSpecies: ; 2a4a0 ## `TryObjectEvent` arbitrary code execution -[engine/events.asm](/engine/events.asm): +In [engine/events.asm](/engine/events.asm): ```asm ; Bug: If IsInArray returns nc, data at bc will be executed as code. @@ -1120,7 +1120,7 @@ ValidateTempWildMonSpecies: ; 2a4a0 ## `Special_CheckBugContestContestantFlag` can read beyond its data table -[event/bug_contest_2.asm](/event/bug_contest_2.asm): +In [event/bug_contest_2.asm](/event/bug_contest_2.asm): ```asm Special_CheckBugContestContestantFlag: ; 139ed @@ -1158,7 +1158,7 @@ BugCatchingContestantEventFlagTable: ; 139fe ## `ClearWRAM` only clears WRAM bank 1 -[home/init.asm](/home/init.asm): +In [home/init.asm](/home/init.asm): ```asm ClearWRAM:: ; 25a @@ -1186,7 +1186,7 @@ ClearWRAM:: ; 25a ## `GetForestTreeFrame` works, but it's still bad -[tilesets/animations.asm](/tilesets/animations.asm): +In [tilesets/animations.asm](/tilesets/animations.asm): ```asm GetForestTreeFrame: ; fc54c -- cgit v1.2.3 From 9ba224e2e68d066d0a82369a403da28d84656787 Mon Sep 17 00:00:00 2001 From: Remy Oukaour Date: Thu, 14 Dec 2017 21:45:35 -0500 Subject: Document two more bugs --- docs/bugs_and_glitches.md | 69 +++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 61 insertions(+), 8 deletions(-) (limited to 'docs') diff --git a/docs/bugs_and_glitches.md b/docs/bugs_and_glitches.md index 9ed7a9ee8..b70f7fcbd 100644 --- a/docs/bugs_and_glitches.md +++ b/docs/bugs_and_glitches.md @@ -10,9 +10,11 @@ - [Counter and Mirror Coat still work if the opponent uses an item](#counter-and-mirror-coat-still-work-if-the-opponent-uses-an-item) - [A Disabled but PP Up–enhanced move may not trigger Struggle](#a-disabled-but-pp-upenhanced-move-may-not-trigger-struggle) - [A Pokémon that fainted from Pursuit will have its old status condition when revived](#a-pokémon-that-fainted-from-pursuit-will-have-its-old-status-condition-when-revived) +- [Lock-On and Mind Reader don't always bypass Fly and Dig](#lock-on-and-mind-reader-dont-always-bypass-fly-and-dig) - [Beat Up can desynchronize link battles](#beat-up-can-desynchronize-link-battles) - [Present damage is incorrect in link battles](#present-damage-is-incorrect-in-link-battles) - ["Smart" AI encourages Mean Look if its own Pokémon is badly poisoned](#smart-ai-encourages-mean-look-if-its-own-pokémon-is-badly-poisoned) +- [AI makes a false assumption about `CheckTypeMatchup`](#ai-makes-a-false-assumption-about-checktypematchup) - [NPC use of Full Heal or Full Restore does not cure Nightmare status](#npc-use-of-full-heal-or-full-restore-does-not-cure-nightmare-status) - [HP bar animation is slow for high HP](#hp-bar-animation-is-slow-for-high-hp) - [HP bar animation off-by-one error for low HP](#hp-bar-animation-off-by-one-error-for-low-hp) @@ -26,9 +28,9 @@ - [Daisy's massages don't always increase happiness](#daisys-massages-dont-always-increase-happiness) - [Magikarp in Lake of Rage are shorter, not longer](#magikarp-in-lake-of-rage-are-shorter-not-longer) - [Battle transitions fail to account for the enemy's level](#battle-transitions-fail-to-account-for-the-enemys-level) +- [Slot machine payout sound effects cut each other off](#slot-machine-payout-sound-effects-cut-each-other-off) - [No bump noise if standing on tile `$3E`](#no-bump-noise-if-standing-on-tile-3e) - [Playing Entei's Pokédex cry can distort Raikou's and Suicune's](#playing-enteis-pokédex-cry-can-distort-raikous-and-suicunes) -- [Lock-On and Mind Reader don't always bypass Fly and Dig](#lock-on-and-mind-reader-dont-always-bypass-fly-and-dig) - [`LoadMetatiles` wraps around past 128 blocks](#loadmetatiles-wraps-around-past-128-blocks) - [Surfing directly across a map connection does not load the new map](#surfing-directly-across-a-map-connection-does-not-load-the-new-map) - [`CheckOwnMon` only checks the first five letters of OT names](#checkownmon-only-checks-the-first-five-letters-of-ot-names) @@ -248,6 +250,13 @@ This is a bug with `CheckPlayerHasUsableMoves` in [battle/core.asm](/battle/core *To do:* Identify specific code causing this bug and fix it. +## Lock-On and Mind Reader don't always bypass Fly and Dig + +This bug affects Attract, Curse, Foresight, Mean Look, Mimic, Nightmare, Spider Web, Transform, and stat-lowering effects of moves like String Shot or Bubble during the semi-invulnerable turn of Fly or Dig. + +*To do:* Identify specific code causing this bug and fix it. + + ## Beat Up can desynchronize link battles ([Video](https://www.youtube.com/watch?v=202-iAsrIa8)) @@ -343,6 +352,35 @@ This is a bug with `AI_Smart_MeanLook` in [battle/ai/scoring.asm](/battle/ai/sco **Fix:** Change `EnemySubStatus5` to `PlayerSubStatus5`. +## AI makes a false assumption about `CheckTypeMatchup` + +In [battle/effect_commands.asm](/battle/effect_commands.asm): + +```asm +BattleCheckTypeMatchup: ; 347c8 + ld hl, EnemyMonType1 + ld a, [hBattleTurn] + and a + jr z, CheckTypeMatchup + ld hl, BattleMonType1 +CheckTypeMatchup: ; 347d3 +; There is an incorrect assumption about this function made in the AI related code: when +; the AI calls CheckTypeMatchup (not BattleCheckTypeMatchup), it assumes that placing the +; offensive type in a will make this function do the right thing. Since a is overwritten, +; this assumption is incorrect. A simple fix would be to load the move type for the +; current move into a in BattleCheckTypeMatchup, before falling through, which is +; consistent with how the rest of the code assumes this code works like. + push hl + push de + push bc + ld a, BATTLE_VARS_MOVE_TYPE + call GetBattleVar + ld d, a +``` + +*To do:* Fix this bug. + + ## NPC use of Full Heal or Full Restore does not cure Nightmare status ([Video](https://www.youtube.com/watch?v=rGqu3d3pdok&t=322)) @@ -742,6 +780,28 @@ StartTrainerBattle_DetermineWhichAnimation: ; 8c365 (23:4365) *To do:* Fix this bug. +## Slot machine payout sound effects cut each other off + +([Video](https://www.youtube.com/watch?v=ojq3xqfRF6I)) + +This is a bug with `Slots_PayoutAnim` in [engine/slot_machine.asm](/engine/slot_machine.asm): + +```asm +.okay + ld [hl], e + dec hl + ld [hl], d + ld a, [wcf64] + and $7 + ret z ; ret nz would be more appropriate + ld de, SFX_GET_COIN_FROM_SLOTS + call PlaySFX + ret +``` + +**Fix:** Change `ret z` to `ret nz`. + + ## No bump noise if standing on tile `$3E` This is a bug with `DoPlayerMovement.CheckWarp` in [engine/player_movement.asm](/engine/player_movement.asm): @@ -815,13 +875,6 @@ The exact cause is unknown, but a workaround exists for `DexEntryScreen_MenuActi ``` -## Lock-On and Mind Reader don't always bypass Fly and Dig - -This bug affects Attract, Curse, Foresight, Mean Look, Mimic, Nightmare, Spider Web, Transform, and stat-lowering effects of moves like String Shot or Bubble during the semi-invulnerable turn of Fly or Dig. - -*To do:* Identify specific code causing this bug and fix it. - - ## `LoadMetatiles` wraps around past 128 blocks This bug prevents you from using blocksets with more than 128 blocks. -- cgit v1.2.3 From 28aec67f6e99db64582f66b26a5c898fe9943e00 Mon Sep 17 00:00:00 2001 From: Remy Oukaour Date: Fri, 15 Dec 2017 00:05:53 -0500 Subject: Document one more bug/oversight Move FleeMons table into data/ --- docs/bugs_and_glitches.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'docs') diff --git a/docs/bugs_and_glitches.md b/docs/bugs_and_glitches.md index b70f7fcbd..31e61dfc0 100644 --- a/docs/bugs_and_glitches.md +++ b/docs/bugs_and_glitches.md @@ -29,6 +29,7 @@ - [Magikarp in Lake of Rage are shorter, not longer](#magikarp-in-lake-of-rage-are-shorter-not-longer) - [Battle transitions fail to account for the enemy's level](#battle-transitions-fail-to-account-for-the-enemys-level) - [Slot machine payout sound effects cut each other off](#slot-machine-payout-sound-effects-cut-each-other-off) +- [Team Rocket battle music is not used for Executives or Scientists](#team-rocket-battle-music-is-not-used-for-executives-or-scientists) - [No bump noise if standing on tile `$3E`](#no-bump-noise-if-standing-on-tile-3e) - [Playing Entei's Pokédex cry can distort Raikou's and Suicune's](#playing-enteis-pokédex-cry-can-distort-raikous-and-suicunes) - [`LoadMetatiles` wraps around past 128 blocks](#loadmetatiles-wraps-around-past-128-blocks) @@ -802,6 +803,36 @@ This is a bug with `Slots_PayoutAnim` in [engine/slot_machine.asm](/engine/slot_ **Fix:** Change `ret z` to `ret nz`. +## Team Rocket battle music is not used for Executives or Scientists + +This is a bug with `PlayBattleMusic` in [main.asm](/main.asm): + +```asm + ; really, they should have included admins and scientists here too... + ld de, MUSIC_ROCKET_BATTLE + cp GRUNTM + jr z, .done + cp GRUNTF + jr z, .done +``` + +**Fix:** + +```asm + ld de, MUSIC_ROCKET_BATTLE + cp GRUNTM + jr z, .done + cp GRUNTF + jr z, .done + cp EXECUTIVEM + jr z, .done + cp EXECUTIVEF + jr z, .done + cp SCIENTIST + jr z, .done +``` + + ## No bump noise if standing on tile `$3E` This is a bug with `DoPlayerMovement.CheckWarp` in [engine/player_movement.asm](/engine/player_movement.asm): -- cgit v1.2.3 From d6dc9351e9876d96c4d471aa1da9b722bbae1c9e Mon Sep 17 00:00:00 2001 From: Remy Oukaour Date: Fri, 15 Dec 2017 00:48:59 -0500 Subject: Start documenting effect commands --- docs/effect_commands.md | 358 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 358 insertions(+) create mode 100644 docs/effect_commands.md (limited to 'docs') diff --git a/docs/effect_commands.md b/docs/effect_commands.md new file mode 100644 index 000000000..172b04b8a --- /dev/null +++ b/docs/effect_commands.md @@ -0,0 +1,358 @@ +# Effect Commands + +Defined in [macros/scripts/effect_commands.asm](/macros/scripts/effect_commands.asm) and [battle/effect_command_pointers.asm:BattleCommandPointers](/battle/effect_command_pointers.asm). + + +## `$01`: `checkturn` + +## `$02`: `checkobedience` + +## `$03`: `usedmovetext` + +## `$04`: `doturn` + +## `$05`: `critical` + +## `$06`: `damagestats` + +## `$07`: `stab` + +## `$08`: `damagevariation` + +## `$09`: `checkhit` + +## `$0A`: `lowersub` + +## `$0B`: `hittargetnosub` + +## `$0C`: `raisesub` + +## `$0D`: `failuretext` + +## `$0E`: `checkfaint` + +## `$0F`: `criticaltext` + +## `$10`: `supereffectivetext` + +## `$11`: `checkdestinybond` + +## `$12`: `buildopponentrage` + +## `$13`: `poisontarget` + +## `$14`: `sleeptarget` + +## `$15`: `draintarget` + +## `$16`: `eatdream` + +## `$17`: `burntarget` + +## `$18`: `freezetarget` + +## `$19`: `paralyzetarget` + +## `$1A`: `selfdestruct` + +## `$1B`: `mirrormove` + +## `$1C`: `statup` + +## `$1D`: `statdown` + +## `$1E`: `payday` + +## `$1F`: `conversion` + +## `$20`: `resetstats` + +## `$21`: `storeenergy` + +## `$22`: `unleashenergy` + +## `$23`: `forceswitch` + +## `$24`: `endloop` + +## `$25`: `flinchtarget` + +## `$26`: `ohko` + +## `$27`: `recoil` + +## `$28`: `mist` + +## `$29`: `focusenergy` + +## `$2A`: `confuse` + +## `$2B`: `confusetarget` + +## `$2C`: `heal` + +## `$2D`: `transform` + +## `$2E`: `screen` + +## `$2F`: `poison` + +## `$30`: `paralyze` + +## `$31`: `substitute` + +## `$32`: `rechargenextturn` + +## `$33`: `mimic` + +## `$34`: `metronome` + +## `$35`: `leechseed` + +## `$36`: `splash` + +## `$37`: `disable` + +## `$38`: `cleartext` + +## `$39`: `charge` + +## `$3A`: `checkcharge` + +## `$3B`: `traptarget` + +## `$3C`: `effect0x3c` + +## `$3D`: `rampage` + +## `$3E`: `checkrampage` + +## `$3F`: `constantdamage` + +## `$40`: `counter` + +## `$41`: `encore` + +## `$42`: `painsplit` + +## `$43`: `snore` + +## `$44`: `conversion2` + +## `$45`: `lockon` + +## `$46`: `sketch` + +## `$47`: `defrostopponent` + +## `$48`: `sleeptalk` + +## `$49`: `destinybond` + +## `$4A`: `spite` + +## `$4B`: `falseswipe` + +## `$4C`: `healbell` + +## `$4D`: `kingsrock` + +## `$4E`: `triplekick` + +## `$4F`: `kickcounter` + +## `$50`: `thief` + +## `$51`: `arenatrap` + +## `$52`: `nightmare` + +## `$53`: `defrost` + +## `$54`: `curse` + +## `$55`: `protect` + +## `$56`: `spikes` + +## `$57`: `foresight` + +## `$58`: `perishsong` + +## `$59`: `startsandstorm` + +## `$5A`: `endure` + +## `$5B`: `checkcurl` + +## `$5C`: `rolloutpower` + +## `$5D`: `effect0x5d` + +## `$5E`: `furycutter` + +## `$5F`: `attract` + +## `$60`: `happinesspower` + +## `$61`: `present` + +## `$62`: `damagecalc` + +## `$63`: `frustrationpower` + +## `$64`: `safeguard` + +## `$65`: `checksafeguard` + +## `$66`: `getmagnitude` + +## `$67`: `batonpass` + +## `$68`: `pursuit` + +## `$69`: `clearhazards` + +## `$6A`: `healmorn` + +## `$6B`: `healday` + +## `$6C`: `healnite` + +## `$6D`: `hiddenpower` + +## `$6E`: `startrain` + +## `$6F`: `startsun` + +## `$70`: `attackup` + +## `$71`: `defenseup` + +## `$72`: `speedup` + +## `$73`: `specialattackup` + +## `$74`: `specialdefenseup` + +## `$75`: `accuracyup` + +## `$76`: `evasionup` + +## `$77`: `attackup2` + +## `$78`: `defenseup2` + +## `$79`: `speedup2` + +## `$7A`: `specialattackup2` + +## `$7B`: `specialdefenseup2` + +## `$7C`: `accuracyup2` + +## `$7D`: `evasionup2` + +## `$7E`: `attackdown` + +## `$7F`: `defensedown` + +## `$80`: `speeddown` + +## `$81`: `specialattackdown` + +## `$82`: `specialdefensedown` + +## `$83`: `accuracydown` + +## `$84`: `evasiondown` + +## `$85`: `attackdown2` + +## `$86`: `defensedown2` + +## `$87`: `speeddown2` + +## `$88`: `specialattackdown2` + +## `$89`: `specialdefensedown2` + +## `$8A`: `accuracydown2` + +## `$8B`: `evasiondown2` + +## `$8C`: `statupmessage` + +## `$8D`: `statdownmessage` + +## `$8E`: `statupfailtext` + +## `$8F`: `statdownfailtext` + +## `$90`: `effectchance` + +## `$91`: `statdownanim` + +## `$92`: `statupanim` + +## `$93`: `switchturn` + +## `$94`: `fakeout` + +## `$95`: `bellydrum` + +## `$96`: `psychup` + +## `$97`: `rage` + +## `$98`: `doubleflyingdamage` + +## `$99`: `doubleundergrounddamage` + +## `$9A`: `mirrorcoat` + +## `$9B`: `checkfuturesight` + +## `$9C`: `futuresight` + +## `$9D`: `doubleminimizedamage` + +## `$9E`: `skipsuncharge` + +## `$9F`: `thunderaccuracy` + +## `$A0`: `teleport` + +## `$A1`: `beatup` + +## `$A2`: `ragedamage` + +## `$A3`: `resettypematchup` + +## `$A4`: `allstatsup` + +## `$A5`: `effect0xa5` + +## `$A6`: `raisesubnoanim` + +## `$A7`: `lowersubnoanim` + +## `$A8`: `effect0xa8` + +## `$A9`: `clearmissdamage` + +## `$AA`: `movedelay` + +## `$AB`: `hittarget` + +## `$AC`: `tristatuschance` + +## `$AD`: `supereffectivelooptext` + +## `$AE`: `startloop` + +## `$AF`: `curl` + +## `$FF`: `endmove` + +## `$00`: `endturn` -- cgit v1.2.3 From d334a331fabe25c4094c4c7e4cd9e270f51c1a30 Mon Sep 17 00:00:00 2001 From: Remy Oukaour Date: Fri, 15 Dec 2017 00:54:45 -0500 Subject: Correct `endturn` value --- docs/effect_commands.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/effect_commands.md b/docs/effect_commands.md index 172b04b8a..3112950a9 100644 --- a/docs/effect_commands.md +++ b/docs/effect_commands.md @@ -353,6 +353,6 @@ Defined in [macros/scripts/effect_commands.asm](/macros/scripts/effect_commands. ## `$AF`: `curl` -## `$FF`: `endmove` +## `$FE`: `endturn` -## `$00`: `endturn` +## `$FF`: `endmove` -- cgit v1.2.3 From 2b6dd505c1674e0d99d649515a8efe868035db09 Mon Sep 17 00:00:00 2001 From: Remy Oukaour Date: Fri, 15 Dec 2017 01:01:57 -0500 Subject: Document another bug Remove an unused file --- docs/bugs_and_glitches.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'docs') diff --git a/docs/bugs_and_glitches.md b/docs/bugs_and_glitches.md index 31e61dfc0..fe0a973dc 100644 --- a/docs/bugs_and_glitches.md +++ b/docs/bugs_and_glitches.md @@ -27,6 +27,7 @@ - [Dragon Scale, not Dragon Fang, boosts Dragon-type moves](#dragon-scale-not-dragon-fang-boosts-dragon-type-moves) - [Daisy's massages don't always increase happiness](#daisys-massages-dont-always-increase-happiness) - [Magikarp in Lake of Rage are shorter, not longer](#magikarp-in-lake-of-rage-are-shorter-not-longer) +- [Magikarp lengths can be miscalculated](#magikarp-lengths-can-be-miscalculated) - [Battle transitions fail to account for the enemy's level](#battle-transitions-fail-to-account-for-the-enemys-level) - [Slot machine payout sound effects cut each other off](#slot-machine-payout-sound-effects-cut-each-other-off) - [Team Rocket battle music is not used for Executives or Scientists](#team-rocket-battle-music-is-not-used-for-executives-or-scientists) @@ -736,6 +737,27 @@ This is a bug with `LoadEnemyMon.CheckMagikarpArea` in [battle/core.asm](/battle **Fix:** Change both `jr z, .Happiness` to `jr nz, .Happiness`. +## Magikarp lengths can be miscalculated + +This is a bug with `CalcMagikarpLength.BCLessThanDE` in [event/magikarp.asm](/event/magikarp.asm): + +```asm +.BCLessThanDE: ; fbc9a +; Intention: Return bc < de. +; Reality: Return b < d. + ld a, b + cp d + ret c + ret nc ; whoops + ld a, c + cp e + ret +; fbca1 +``` + +**Fix:** Delete `ret nc`. + + ## Battle transitions fail to account for the enemy's level ([Video](https://www.youtube.com/watch?v=eij_1060SMc)) -- cgit v1.2.3 From 3ed016f9e05356e941d89237ae9d7858d436ba35 Mon Sep 17 00:00:00 2001 From: Remy Oukaour Date: Sun, 17 Dec 2017 19:48:04 -0500 Subject: Auto-label more map scripts --- docs/bugs_and_glitches.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/bugs_and_glitches.md b/docs/bugs_and_glitches.md index fe0a973dc..a3fbc769a 100644 --- a/docs/bugs_and_glitches.md +++ b/docs/bugs_and_glitches.md @@ -25,7 +25,7 @@ - [Love Ball boosts catch rate for the wrong gender](#love-ball-boosts-catch-rate-for-the-wrong-gender) - [Fast Ball only boosts catch rate for three Pokémon](#fast-ball-only-boosts-catch-rate-for-three-pokémon) - [Dragon Scale, not Dragon Fang, boosts Dragon-type moves](#dragon-scale-not-dragon-fang-boosts-dragon-type-moves) -- [Daisy's massages don't always increase happiness](#daisys-massages-dont-always-increase-happiness) +- [Daisy's grooming doesn't always increase happiness](#daisys-grooming-doesnt-always-increase-happiness) - [Magikarp in Lake of Rage are shorter, not longer](#magikarp-in-lake-of-rage-are-shorter-not-longer) - [Magikarp lengths can be miscalculated](#magikarp-lengths-can-be-miscalculated) - [Battle transitions fail to account for the enemy's level](#battle-transitions-fail-to-account-for-the-enemys-level) @@ -662,7 +662,7 @@ This is a bug with `ItemAttributes` in [items/item_attributes.asm](/items/item_a **Fix:** Move `HELD_DRAGON_BOOST` to the `DRAGON FANG` attributes and `0` to `DRAGON SCALE`. -## Daisy's massages don't always increase happiness +## Daisy's grooming doesn't always increase happiness This is a bug with `MassageOrHaircut` in [event/special.asm](/event/special.asm): -- cgit v1.2.3 From 2fa1e97aebdb23445355a74ca7f49787508f4f0d Mon Sep 17 00:00:00 2001 From: Remy Oukaour Date: Tue, 19 Dec 2017 19:04:56 -0500 Subject: Document two more bugs --- docs/bugs_and_glitches.md | 80 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 78 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/bugs_and_glitches.md b/docs/bugs_and_glitches.md index a3fbc769a..688a4d455 100644 --- a/docs/bugs_and_glitches.md +++ b/docs/bugs_and_glitches.md @@ -256,7 +256,18 @@ This is a bug with `CheckPlayerHasUsableMoves` in [battle/core.asm](/battle/core This bug affects Attract, Curse, Foresight, Mean Look, Mimic, Nightmare, Spider Web, Transform, and stat-lowering effects of moves like String Shot or Bubble during the semi-invulnerable turn of Fly or Dig. -*To do:* Identify specific code causing this bug and fix it. +This is a bug with `CheckHiddenOpponent` in [battle/effect_commands.asm](/battle/effect_commands.asm): + +```asm +CheckHiddenOpponent: ; 37daa +; BUG: This routine should account for Lock-On and Mind Reader. + ld a, BATTLE_VARS_SUBSTATUS3_OPP + call GetBattleVar + and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND + ret +``` + +*To do:* Fix this bug. ## Beat Up can desynchronize link battles @@ -1007,7 +1018,72 @@ endr This bug can affect Mew or Pokémon other than Ditto that used Transform via Mirror Move or Sketch. -*To do:* Identify specific code causing this bug and fix it. +This is a bug with `PokeBall` in [items/item_effects.asm](/items/item_effects.asm): + +```asm + ld hl, EnemySubStatus5 + ld a, [hl] + push af + set SUBSTATUS_TRANSFORMED, [hl] + +; This code is buggy. Any wild Pokémon that has Transformed will be +; caught as a Ditto, even if it was something else like Mew. +; To fix, do not set [TempEnemyMonSpecies] to DITTO. + bit SUBSTATUS_TRANSFORMED, a + jr nz, .ditto + jr .not_ditto + +.ditto + ld a, DITTO + ld [TempEnemyMonSpecies], a + jr .load_data + +.not_ditto + set SUBSTATUS_TRANSFORMED, [hl] + ld hl, wEnemyBackupDVs + ld a, [EnemyMonDVs] + ld [hli], a + ld a, [EnemyMonDVs + 1] + ld [hl], a + +.load_data + ld a, [TempEnemyMonSpecies] + ld [CurPartySpecies], a + ld a, [EnemyMonLevel] + ld [CurPartyLevel], a + callba LoadEnemyMon + + pop af + ld [EnemySubStatus5], a +``` + +**Fix:** + +```asm + ld hl, EnemySubStatus5 + ld a, [hl] + push af + set SUBSTATUS_TRANSFORMED, [hl] + + bit SUBSTATUS_TRANSFORMED, a + jr nz, .load_data + + ld hl, wEnemyBackupDVs + ld a, [EnemyMonDVs] + ld [hli], a + ld a, [EnemyMonDVs + 1] + ld [hl], a + +.load_data + ld a, [TempEnemyMonSpecies] + ld [CurPartySpecies], a + ld a, [EnemyMonLevel] + ld [CurPartyLevel], a + callba LoadEnemyMon + + pop af + ld [EnemySubStatus5], a +``` ## Using a Park Ball in normal battles has a corrupt animation -- cgit v1.2.3 From 02609940dbf50e1a4d7052646bedd67a2796136b Mon Sep 17 00:00:00 2001 From: Remy Oukaour Date: Thu, 21 Dec 2017 11:43:41 -0500 Subject: Document one more bug --- docs/bugs_and_glitches.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'docs') diff --git a/docs/bugs_and_glitches.md b/docs/bugs_and_glitches.md index 688a4d455..596463a09 100644 --- a/docs/bugs_and_glitches.md +++ b/docs/bugs_and_glitches.md @@ -35,6 +35,7 @@ - [Playing Entei's Pokédex cry can distort Raikou's and Suicune's](#playing-enteis-pokédex-cry-can-distort-raikous-and-suicunes) - [`LoadMetatiles` wraps around past 128 blocks](#loadmetatiles-wraps-around-past-128-blocks) - [Surfing directly across a map connection does not load the new map](#surfing-directly-across-a-map-connection-does-not-load-the-new-map) +- [`Function6ec1` does not correctly limit object movement](#function6ec1-does-not-correctly-limit-object-movement) - [`CheckOwnMon` only checks the first five letters of OT names](#checkownmon-only-checks-the-first-five-letters-of-ot-names) - [Catching a Transformed Pokémon always catches a Ditto](#catching-a-transformed-pokémon-always-catches-a-ditto) - [Using a Park Ball in normal battles has a corrupt animation](#using-a-park-ball-in-normal-battles-has-a-corrupt-animation) @@ -974,6 +975,22 @@ In [home/map.asm](/home/map.asm): *To do:* Identify specific code causing this bug and fix it. +## `Function6ec1` does not correctly limit object movement + +This bug is why the Lapras in Union Cave, which uses `SPRITEMOVEDATA_LAPRAS`, is not restricted by its `1, 1` movement radius. + +In [engine/npc_movement.asm](/engine/npc_movement.asm): + +```asm + ld hl, OBJECT_FLAGS1 + add hl, bc + bit 4, [hl] ; lost, uncomment next line to fix +; jr nz, .resume +``` + +**Fix:** Uncomment `jr nz, .resume`. + + ## `CheckOwnMon` only checks the first five letters of OT names ([Video](https://www.youtube.com/watch?v=GVTTmReM4nQ)) -- cgit v1.2.3 From ff4d25eee37c0947736258a5f9dea89072b3d7e3 Mon Sep 17 00:00:00 2001 From: Remy Oukaour Date: Thu, 21 Dec 2017 12:11:35 -0500 Subject: Include bugfix in comments --- docs/bugs_and_glitches.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/docs/bugs_and_glitches.md b/docs/bugs_and_glitches.md index 596463a09..a72e4afc3 100644 --- a/docs/bugs_and_glitches.md +++ b/docs/bugs_and_glitches.md @@ -878,6 +878,8 @@ This is a bug with `DoPlayerMovement.CheckWarp` in [engine/player_movement.asm]( ; 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 @@ This is a bug with `DoPlayerMovement.CheckWarp` in [engine/player_movement.asm]( 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 @@ In [engine/overworld.asm](/engine/overworld.asm): ```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 @@ LoadSpriteGFX: ; 14306 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 -- cgit v1.2.3 From 763bd48141340ca55d7d4ad94c46c8ee212bf86d Mon Sep 17 00:00:00 2001 From: Remy Oukaour Date: Fri, 22 Dec 2017 17:52:34 -0500 Subject: Document a graphical error --- docs/bugs_and_glitches.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'docs') diff --git a/docs/bugs_and_glitches.md b/docs/bugs_and_glitches.md index a72e4afc3..de7305588 100644 --- a/docs/bugs_and_glitches.md +++ b/docs/bugs_and_glitches.md @@ -33,6 +33,7 @@ - [Team Rocket battle music is not used for Executives or Scientists](#team-rocket-battle-music-is-not-used-for-executives-or-scientists) - [No bump noise if standing on tile `$3E`](#no-bump-noise-if-standing-on-tile-3e) - [Playing Entei's Pokédex cry can distort Raikou's and Suicune's](#playing-enteis-pokédex-cry-can-distort-raikous-and-suicunes) +- [In-battle “`…`” ellipsis is too high](#in-battle--ellipsis-is-too-high) - [`LoadMetatiles` wraps around past 128 blocks](#loadmetatiles-wraps-around-past-128-blocks) - [Surfing directly across a map connection does not load the new map](#surfing-directly-across-a-map-connection-does-not-load-the-new-map) - [`Function6ec1` does not correctly limit object movement](#function6ec1-does-not-correctly-limit-object-movement) @@ -943,6 +944,17 @@ The exact cause is unknown, but a workaround exists for `DexEntryScreen_MenuActi ``` +## In-battle “`…`” ellipsis is too high + +This is a mistake with the “`…`” tile in [gfx/battle/hp_exp_bar_border.png](/gfx/battle/hp_exp_bar_border.png): + +![image](https://i.imgur.com/hVK5ofi.png) + +**Fix:** Lower the ellipsis by two pixels: + +![image](https://i.imgur.com/qfMvhlG.png) + + ## `LoadMetatiles` wraps around past 128 blocks This bug prevents you from using blocksets with more than 128 blocks. -- cgit v1.2.3 From ae3bef55963ba51d5e760c8d7fd052333fccd75e Mon Sep 17 00:00:00 2001 From: Remy Oukaour Date: Fri, 22 Dec 2017 17:59:50 -0500 Subject: Document one more graphical mistake --- docs/bugs_and_glitches.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'docs') diff --git a/docs/bugs_and_glitches.md b/docs/bugs_and_glitches.md index de7305588..6feeb8fa0 100644 --- a/docs/bugs_and_glitches.md +++ b/docs/bugs_and_glitches.md @@ -34,6 +34,7 @@ - [No bump noise if standing on tile `$3E`](#no-bump-noise-if-standing-on-tile-3e) - [Playing Entei's Pokédex cry can distort Raikou's and Suicune's](#playing-enteis-pokédex-cry-can-distort-raikous-and-suicunes) - [In-battle “`…`” ellipsis is too high](#in-battle--ellipsis-is-too-high) +- [Two tiles in the `port` tileset are drawn incorrectly](#two-tiles-in-the-port-tileset-are-drawn-incorrectly) - [`LoadMetatiles` wraps around past 128 blocks](#loadmetatiles-wraps-around-past-128-blocks) - [Surfing directly across a map connection does not load the new map](#surfing-directly-across-a-map-connection-does-not-load-the-new-map) - [`Function6ec1` does not correctly limit object movement](#function6ec1-does-not-correctly-limit-object-movement) @@ -955,6 +956,17 @@ This is a mistake with the “`…`” tile in [gfx/battle/hp_exp_bar_border.png ![image](https://i.imgur.com/qfMvhlG.png) +## Two tiles in the `port` tileset are drawn incorrectly + +This is a mistake with the top-left and top-right warp carpet tiles in [gfx/tilesets/port.png](/gfx/tilesets/port.png): + +![image](https://i.imgur.com/6SJuORN.png) + +**Fix:** Adjust them to match the right-hand corner tiles: + +![image](https://i.imgur.com/PD3Fjdu.png) + + ## `LoadMetatiles` wraps around past 128 blocks This bug prevents you from using blocksets with more than 128 blocks. -- cgit v1.2.3 From 1ecbfc49f402c777c365f3c48bea5f21ad4e4c48 Mon Sep 17 00:00:00 2001 From: Remy Oukaour Date: Fri, 22 Dec 2017 18:01:06 -0500 Subject: Correct directions --- docs/bugs_and_glitches.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/bugs_and_glitches.md b/docs/bugs_and_glitches.md index 6feeb8fa0..97f75f83f 100644 --- a/docs/bugs_and_glitches.md +++ b/docs/bugs_and_glitches.md @@ -958,7 +958,7 @@ This is a mistake with the “`…`” tile in [gfx/battle/hp_exp_bar_border.png ## Two tiles in the `port` tileset are drawn incorrectly -This is a mistake with the top-left and top-right warp carpet tiles in [gfx/tilesets/port.png](/gfx/tilesets/port.png): +This is a mistake with the left-hand warp carpet corner tiles in [gfx/tilesets/port.png](/gfx/tilesets/port.png): ![image](https://i.imgur.com/6SJuORN.png) -- cgit v1.2.3 From 82a8228e67efa5949e58d8eb449477d46fb9669f Mon Sep 17 00:00:00 2001 From: Remy Oukaour Date: Sat, 23 Dec 2017 12:08:34 -0500 Subject: Keep images within repo --- docs/bugs_and_glitches.md | 8 ++++---- docs/images/hp_exp_bar_border.png | Bin 0 -> 125 bytes docs/images/hp_exp_bar_border_fix.png | Bin 0 -> 124 bytes docs/images/port.png | Bin 0 -> 1055 bytes docs/images/port_fix.png | Bin 0 -> 1056 bytes 5 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 docs/images/hp_exp_bar_border.png create mode 100644 docs/images/hp_exp_bar_border_fix.png create mode 100644 docs/images/port.png create mode 100644 docs/images/port_fix.png (limited to 'docs') diff --git a/docs/bugs_and_glitches.md b/docs/bugs_and_glitches.md index 97f75f83f..b38ec12ee 100644 --- a/docs/bugs_and_glitches.md +++ b/docs/bugs_and_glitches.md @@ -949,22 +949,22 @@ The exact cause is unknown, but a workaround exists for `DexEntryScreen_MenuActi This is a mistake with the “`…`” tile in [gfx/battle/hp_exp_bar_border.png](/gfx/battle/hp_exp_bar_border.png): -![image](https://i.imgur.com/hVK5ofi.png) +![image](/docs/images/hp_exp_bar_border.png) **Fix:** Lower the ellipsis by two pixels: -![image](https://i.imgur.com/qfMvhlG.png) +![image](/docs/images/hp_exp_bar_border_fix.png) ## Two tiles in the `port` tileset are drawn incorrectly This is a mistake with the left-hand warp carpet corner tiles in [gfx/tilesets/port.png](/gfx/tilesets/port.png): -![image](https://i.imgur.com/6SJuORN.png) +![image](/docs/images/port.png) **Fix:** Adjust them to match the right-hand corner tiles: -![image](https://i.imgur.com/PD3Fjdu.png) +![image](/docs/images/port_fix.png) ## `LoadMetatiles` wraps around past 128 blocks diff --git a/docs/images/hp_exp_bar_border.png b/docs/images/hp_exp_bar_border.png new file mode 100644 index 000000000..9d16a042b Binary files /dev/null and b/docs/images/hp_exp_bar_border.png differ diff --git a/docs/images/hp_exp_bar_border_fix.png b/docs/images/hp_exp_bar_border_fix.png new file mode 100644 index 000000000..02d36f8a0 Binary files /dev/null and b/docs/images/hp_exp_bar_border_fix.png differ diff --git a/docs/images/port.png b/docs/images/port.png new file mode 100644 index 000000000..8a18aad7d Binary files /dev/null and b/docs/images/port.png differ diff --git a/docs/images/port_fix.png b/docs/images/port_fix.png new file mode 100644 index 000000000..055a377a5 Binary files /dev/null and b/docs/images/port_fix.png differ -- cgit v1.2.3