Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document Fix for Battle Transitions No Party Bug #113

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions docs/bugs_and_glitches.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -41,7 +42,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
Expand All @@ -53,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)