From 5f683cfcc79cc0aa8bb7fc53c6970568c2f05414 Mon Sep 17 00:00:00 2001 From: TiKevin83 Date: Tue, 31 Oct 2023 03:08:08 -0400 Subject: [PATCH 1/2] Add fix documentation for battle transition empty party glitch --- docs/bugs_and_glitches.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/bugs_and_glitches.md b/docs/bugs_and_glitches.md index fa1050fd1..0c7acc25c 100644 --- a/docs/bugs_and_glitches.md +++ b/docs/bugs_and_glitches.md @@ -41,7 +41,15 @@ The Battle Transitions code has no error handling for this and reads wPartyMon1H This means you can manipulate this first transition to be faster by choosing a default rival name or writing and deleting 6 characters in a custom rival name. A similar series of bugs appears to exist in pokecrystal. -**Fix:** TBD in [engine/battle/battle_transitions.asm#L93](/engine/battle/battle_transitions.asm#L93) +**Fix:** Update [engine/battle/battle_transitions.asm#L93](/engine/battle/battle_transitions.asm#L93) + +```diff +GetBattleTransitionID_CompareLevels: ++ ld a, [wPartyCount] ++ cp 0 ++ jr z, .highLevelEnemy + ld hl, wPartyMon1HP +``` ## `wPikachuFollowCommandBuffer` can overflow From 344999a75e906de6de23983e3ea606a8013a5789 Mon Sep 17 00:00:00 2001 From: TiKevin83 Date: Tue, 31 Oct 2023 05:40:17 -0400 Subject: [PATCH 2/2] Update bugs and glitches doc per current state of pokered --- docs/bugs_and_glitches.md | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/docs/bugs_and_glitches.md b/docs/bugs_and_glitches.md index 0c7acc25c..2342d822c 100644 --- a/docs/bugs_and_glitches.md +++ b/docs/bugs_and_glitches.md @@ -2,6 +2,8 @@ These are sections of the original Pokémon Yellow game code that clearly do not work as intended or only work in limited circumstances. +Many of the [documented fixes for Red](https://github.com/pret/pokered/wiki/%5BARCHIVED%5D-Bugs-and-Glitches#using-the-pok%C3%A9doll-on-the-ghost-marowak-can-allow-you-to-sequence-break) also apply to this codebase, the fixes called out here will attempt to be distinct to Yellow and in some cases Gen 2 where Yellow specific parts were reused. + Fixes are written in the `diff` format. If you've used Git before, this should look familiar: ```diff @@ -16,7 +18,6 @@ Fixes are written in the `diff` format. If you've used Git before, this should l - [Options menu code fails to clear joypad state on initialization](#options-menu-code-fails-to-clear-joypad-state-on-initialization) - [Battle transitions fail to account for scripted battles](#battle-transitions-fail-to-account-for-scripted-battles) - [`wPikachuFollowCommandBuffer` can overflow](#wpikachufollowcommandbuffer-can-overflow) -- [Unexpected Counter damage](#unexpected-counter-damage) ## Options menu code fails to clear joypad state on initialization @@ -61,11 +62,3 @@ This bug is generally known as "Pikawalk." A typical use for this would be to force the in game time to 255:59. **Fix:** TBD in [engine/pikachu/pikachu_follow.asm#1165](/engine/pikachu/pikachu_follow.asm#1165) - - -## Unexpected Counter damage - -Counter simply doubles the value of wDamage which can hold the last value of damage dealt whether it was from you, your opponent, a switched out opponent, or a player in another battle. -This is because wDamage is used for both the player's damage and opponent's damage, and is not cleared out between switching or battles. - -**Fix:** TBD in [engine/battle/core.asm#L4960](/engine/battle/core.asm#L4960)