Merge pull request #546 from Rangi42/master

Reword bug docs now that they use diffs
This commit is contained in:
Rangi 2018-07-28 01:06:54 -04:00 committed by GitHub
commit ee8479f05e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 515 additions and 615 deletions

View File

@ -12,8 +12,9 @@ Fixes are written in the `diff` format. If you're familiar with git, this should
## 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)
- [Thick Club and Light Ball can make (Special) Attack wrap around above 1024](#thick-club-and-light-ball-can-make-special-attack-wrap-around-above-1024)
- [Metal Powder can increase damage taken with boosted (Special) Defense](#metal-powder-can-increase-damage-taken-with-boosted-special-defense)
- [Reflect and Light Screen can make (Special) Defense wrap around above 1024](#reflect-and-light-screen-can-make-special-defense-wrap-around-above-1024)
- [Belly Drum sharply boosts Attack even with under 50% HP](#belly-drum-sharply-boosts-attack-even-with-under-50-hp)
- [Confusion damage is affected by type-boosting items and Explosion/Self-Destruct doubling](#confusion-damage-is-affected-by-type-boosting-items-and-explosionself-destruct-doubling)
- [Moves that lower Defense can do so after breaking a Substitute](#moves-that-lower-defense-can-do-so-after-breaking-a-substitute)
@ -22,7 +23,8 @@ Fixes are written in the `diff` format. If you're familiar with git, this should
- [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)
- [Beat Up may fail to raise substitute](#beat-up-may-fail-to-raise-substitute)
- [Beat Up works incorrectly with only one Pokémon in the party](#beat-up-works-incorrectly-with-only-one-pokémon-in-the-party)
- [Beat Up may fail to raise Substitute](#beat-up-may-fail-to-raise-substitute)
- [Beat Up may trigger King's Rock even if it failed](#beat-up-may-trigger-kings-rock-even-if-it-failed)
- [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)
@ -65,19 +67,16 @@ Fixes are written in the `diff` format. If you're familiar with git, this should
- [`ClearWRAM` only clears WRAM bank 1](#clearwram-only-clears-wram-bank-1)
## Thick Club and Light Ball can decrease damage done with boosted (Special) Attack
## Thick Club and Light Ball can make (Special) Attack wrap around above 1024
*Fixing this bug will break compatibility with standard Pokémon Crystal for link battles.*
([Video](https://www.youtube.com/watch?v=rGqu3d3pdok&t=450))
This is a bug with `SpeciesItemBoost` in [engine/battle/effect_commands.asm](/engine/battle/effect_commands.asm):
**Fix:**
**Fix:** Edit `SpeciesItemBoost` in [engine/battle/effect_commands.asm](/engine/battle/effect_commands.asm)
```diff
; Double the stat
; Double the stat
sla l
rl h
+
@ -101,10 +100,7 @@ This is a bug with `SpeciesItemBoost` in [engine/battle/effect_commands.asm](/en
([Video](https://www.youtube.com/watch?v=rGqu3d3pdok&t=450))
This is a bug with `DittoMetalPowder` in [engine/battle/effect_commands.asm](/engine/battle/effect_commands.asm):
**Fix:**
**Fix:** Edit `DittoMetalPowder` in [engine/battle/effect_commands.asm](/engine/battle/effect_commands.asm):
```diff
ld a, c
@ -118,7 +114,7 @@ This is a bug with `DittoMetalPowder` in [engine/battle/effect_commands.asm](/en
and a
jr nz, .done
inc b
.done
.done
scf
rr c
+
@ -136,35 +132,61 @@ This is a bug with `DittoMetalPowder` in [engine/battle/effect_commands.asm](/en
```
## Reflect and Light Screen can make (Special) Defense wrap around above 1024
*Fixing this bug will break compatibility with standard Pokémon Crystal for link battles.*
This bug existed for all battles in Gold and Silver, and was only fixed for single-player battles in Crystal to preserve link compatibility.
**Fix:** Edit `TruncateHL_BC` in [engine/battle/effect_commands.asm](/engine/battle/effect_commands.asm)
```diff
.finish
- ld a, [wLinkMode]
- cp LINK_COLOSSEUM
- jr z, .done
; If we go back to the loop point,
; it's the same as doing this exact
; same check twice.
ld a, h
or b
jr nz, .loop
-.done
ld b, l
ret
```
(This fix also affects Thick Club, Light Ball, and Metal Powder, as described above, but their specific fixes in the above bugs allow more accurate damage calculations.)
## Belly Drum sharply boosts Attack even with under 50% HP
*Fixing this bug will break compatibility with standard Pokémon Crystal for link battles.*
([Video](https://www.youtube.com/watch?v=zuCLMikWo4Y))
This is a bug with `BattleCommand_BellyDrum` in [engine/battle/move_effects/belly_drum.asm](/engine/battle/move_effects/belly_drum.asm):
**Fix:**
**Fix:** Edit `BattleCommand_BellyDrum` in [engine/battle/move_effects/belly_drum.asm](/engine/battle/move_effects/belly_drum.asm):
```diff
BattleCommand_BellyDrum:
; bellydrum
BattleCommand_BellyDrum:
; bellydrum
-; This command is buggy because it raises the user's attack
-; before checking that it has enough HP to use the move.
-; Swap the order of these two blocks to fix.
+ callfar GetHalfMaxHP
+ callfar CheckUserHasEnoughHP
+ jr nc, .failed
+
call BattleCommand_AttackUp2
ld a, [wAttackMissed]
and a
jr nz, .failed
- call BattleCommand_AttackUp2
- ld a, [wAttackMissed]
- and a
- jr nz, .failed
-
- callfar GetHalfMaxHP
- callfar CheckUserHasEnoughHP
- jr nc, .failed
callfar GetHalfMaxHP
callfar CheckUserHasEnoughHP
jr nc, .failed
+
+ call BattleCommand_AttackUp2
+ ld a, [wAttackMissed]
+ and a
+ jr nz, .failed
```
@ -185,13 +207,10 @@ BattleCommand_BellyDrum:
This bug affects Acid, Iron Tail, and Rock Smash.
This is a bug with `DefenseDownHit` in [data/moves/effects.asm](/data/moves/effects.asm):
**Fix:** Edit `DefenseDownHit` in [data/moves/effects.asm](/data/moves/effects.asm):
**Fix:**
```asm
DefenseDownHit:
```diff
DefenseDownHit:
checkobedience
usedmovetext
doturn
@ -222,10 +241,7 @@ DefenseDownHit:
([Video](https://www.youtube.com/watch?v=uRYyzKRatFk))
This is a bug with `BattleCommand_Counter` in [engine/battle/move_effects/counter.asm](/engine/battle/move_effects/counter.asm) and `BattleCommand_MirrorCoat` in [engine/battle/move_effects/mirror_coat.asm](/engine/battle/move_effects/mirror_coat.asm):
**Fix:**
**Fix:** Edit `BattleCommand_Counter` in [engine/battle/move_effects/counter.asm](/engine/battle/move_effects/counter.asm) and `BattleCommand_MirrorCoat` in [engine/battle/move_effects/mirror_coat.asm](/engine/battle/move_effects/mirror_coat.asm):
```diff
- ; BUG: Move should fail with all non-damaging battle actions
@ -253,19 +269,16 @@ Add this to the end of each file:
([Video](https://www.youtube.com/watch?v=1v9x4SgMggs))
This is a bug with `CheckPlayerHasUsableMoves` in [engine/battle/core.asm](/engine/battle/core.asm):
**Fix:**
**Fix:** Edit `CheckPlayerHasUsableMoves` in [engine/battle/core.asm](/engine/battle/core.asm):
```diff
.done
.done
- ; Bug: this will result in a move with PP Up confusing the game.
- and a ; should be "and PP_MASK"
+ and PP_MASK
ret nz
.force_struggle
.force_struggle
ld hl, BattleText_MonHasNoMovesLeft
call StdBattleTextBox
ld c, 60
@ -290,22 +303,18 @@ This is a bug with `CheckPlayerHasUsableMoves` in [engine/battle/core.asm](/engi
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.
This is a bug with `CheckHiddenOpponent` in [engine/battle/effect_commands.asm](/engine/battle/effect_commands.asm):
**Fix:**
**Fix:** Edit `CheckHiddenOpponent` in [engine/battle/effect_commands.asm](/engine/battle/effect_commands.asm):
```diff
CheckHiddenOpponent:
-CheckHiddenOpponent:
-; BUG: This routine is completely redundant and introduces a bug, since BattleCommand_CheckHit does these checks properly.
- ld a, BATTLE_VARS_SUBSTATUS3_OPP
- call GetBattleVar
- and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND
+ xor a
ret
```
The code in `CheckHiddenOpponent` is completely redundant as `BattleCommand_CheckHit` already does what this code is doing. Another option is to remove `CheckHiddenOpponent` completely, the calls to `CheckHiddenOpponent`, and the jump afterwards.
## Beat Up can desynchronize link battles
@ -313,13 +322,10 @@ The code in `CheckHiddenOpponent` is completely redundant as `BattleCommand_Chec
([Video](https://www.youtube.com/watch?v=202-iAsrIa8))
This is a bug with `BattleCommand_BeatUp` in [engine/battle/move_effects/beat_up.asm](/engine/battle/move_effects/beat_up.asm):
**Fix:**
**Fix:** Edit `BattleCommand_BeatUp` in [engine/battle/move_effects/beat_up.asm](/engine/battle/move_effects/beat_up.asm):
```diff
.got_mon
.got_mon
ld a, [wd002]
ld hl, wPartyMonNicknames
call GetNick
@ -339,27 +345,23 @@ This is a bug with `BattleCommand_BeatUp` in [engine/battle/move_effects/beat_up
jr z, .active_mon
ld a, MON_STATUS
call GetBeatupMonLocation
.active_mon
.active_mon
ld a, [hl]
and a
jp nz, .beatup_fail
```
## Beat Up may fail to raise substitute
## Beat Up works incorrectly with only one Pokémon in the party
*Fixing this bug will break compatibility with standard Pokémon Crystal for link battles.*
(Only the fixes denoted with "breaking" will actually break compatibility, the others just affect what's shown on the screen with the patched game)
*Fixing this bug may break compatibility with standard Pokémon Crystal for link battles.*
This is a bug in `BattleCommand_EndLoop` in [engine/battle/effect_commands.asm](/engine/battle/effect_commands.asm) that prevents the rest of the move's effect from being executed if the player or enemy only has one mon in their party while using Beat Up.
This bug prevents the rest of Beat Up's effect from being executed if the player or enemy only has one Pokémon in their party while using it. It prevents Substitute from being raised and King's Rock from working.
It prevents the substitute from being raised and the King's Rock from working.
**Fix (breaking):**
**Fix:** Edit `BattleCommand_EndLoop` in [engine/battle/effect_commands.asm](/engine/battle/effect_commands.asm):
```diff
.only_one_beatup
.only_one_beatup
ld a, BATTLE_VARS_SUBSTATUS3
call GetBattleVarAddr
res SUBSTATUS_IN_LOOP, [hl]
@ -368,10 +370,10 @@ It prevents the substitute from being raised and the King's Rock from working.
+ ret
```
**Fix (cosmetics):**
**Cosmetic fix:** This fix does not break compatibility, but it only affects what's shown on the screen for the patched game.
```diff
.only_one_beatup
.only_one_beatup
ld a, BATTLE_VARS_SUBSTATUS3
call GetBattleVarAddr
res SUBSTATUS_IN_LOOP, [hl]
@ -381,12 +383,13 @@ It prevents the substitute from being raised and the King's Rock from working.
```
There's a similar oversight in `BattleCommand_FailureText` in [engine/battle/effect_commands.asm](/engine/battle/effect_commands.asm) that will prevent the substitute from being raised if Beat Up is protected against.
## Beat Up may fail to raise Substitute
This bug prevents Substitute from being raised if Beat Up was blocked by Protect or Detect.
**Fix (cosmetics):**
**Fix:** Edit `BattleCommand_FailureText` in [engine/battle/effect_commands.asm](/engine/battle/effect_commands.asm).
```asm
```diff
cp EFFECT_MULTI_HIT
jr z, .multihit
cp EFFECT_DOUBLE_HIT
@ -397,7 +400,7 @@ There's a similar oversight in `BattleCommand_FailureText` in [engine/battle/eff
+ jr z, .multihit
jp EndMoveEffect
.multihit
.multihit
call BattleCommand_RaiseSub
jp EndMoveEffect
```
@ -407,16 +410,13 @@ There's a similar oversight in `BattleCommand_FailureText` in [engine/battle/eff
*Fixing this bug will break compatibility with standard Pokémon Crystal for link battles.*
This is a bug in how `wAttackMissed` is never set by BeatUp, even when none of the 'mon have been able to attack (due to being fainted or having a status effect), the King's Rock may activate.
This bug is caused because Beat Up never sets `wAttackMissed`, even when no Pokémon was able to attack (due to being fainted or having a status condition).
This bug can be fixed in a plethora of ways, but the most straight-forward would be in `BattleCommand_BeatUpFailText` in [engine/battle/move_effects/beat_up.asm](/engine/battle/move_effects/beat_up.asm), as that's always ran before the king's rock effect.
**Fix:**
**Fix:** Edit `BattleCommand_BeatUpFailText` in [engine/battle/move_effects/beat_up.asm](/engine/battle/move_effects/beat_up.asm):
```diff
BattleCommand_BeatUpFailText:
; beatupfailtext
BattleCommand_BeatUpFailText:
; beatupfailtext
ld a, [wBeatUpHitAtLeastOnce]
and a
@ -437,14 +437,11 @@ BattleCommand_BeatUpFailText:
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 [engine/battle/move_effects/present.asm](/engine/battle/move_effects/present.asm):
**Fix:**
**Fix:** Edit `BattleCommand_Present` in [engine/battle/move_effects/present.asm](/engine/battle/move_effects/present.asm):
```diff
BattleCommand_Present:
; present
BattleCommand_Present:
; present
- ld a, [wLinkMode]
- cp LINK_COLOSSEUM
@ -468,10 +465,7 @@ BattleCommand_Present:
([Video](https://www.youtube.com/watch?v=cygMO-zHTls))
This is a bug with `AI_Smart_MeanLook` in [engine/battle/ai/scoring.asm](/engine/battle/ai/scoring.asm):
**Fix:**
**Fix:** Edit `AI_Smart_MeanLook` in [engine/battle/ai/scoring.asm](/engine/battle/ai/scoring.asm):
```diff
-; 80% chance to greatly encourage this move if the enemy is badly poisoned (buggy).
@ -486,7 +480,7 @@ This is a bug with `AI_Smart_MeanLook` in [engine/battle/ai/scoring.asm](/engine
## AI makes a false assumption about `CheckTypeMatchup`
In [engine/battle/effect_commands.asm](/engine/battle/effect_commands.asm):
In [engine/battle/effect_commands.asm](/engine/battle/effect_commands.asm).
```asm
BattleCheckTypeMatchup:
@ -517,13 +511,10 @@ CheckTypeMatchup:
([Video](https://www.youtube.com/watch?v=rGqu3d3pdok&t=322))
This is a bug with `AI_HealStatus` in [engine/battle/ai/items.asm](/engine/battle/ai/items.asm):
**Fix:**
**Fix:** Edit `AI_HealStatus` in [engine/battle/ai/items.asm](/engine/battle/ai/items.asm):
```diff
AI_HealStatus:
AI_HealStatus:
ld a, [wCurOTMon]
ld hl, wOTPartyMon1Status
ld bc, PARTYMON_STRUCT_LENGTH
@ -547,10 +538,7 @@ AI_HealStatus:
([Video](https://www.youtube.com/watch?v=SE-BfsFgZVM))
This is a bug with `LongAnim_UpdateVariables` in [engine/battle/anim_hp_bar.asm](/engine/battle/anim_hp_bar.asm):
**Fix:**
**Fix:** Edit `LongAnim_UpdateVariables` in [engine/battle/anim_hp_bar.asm](/engine/battle/anim_hp_bar.asm):
```diff
- ; This routine is buggy. The result from ComputeHPBarPixels is stored
@ -577,17 +565,14 @@ This is a bug with `LongAnim_UpdateVariables` in [engine/battle/anim_hp_bar.asm]
([Video](https://www.youtube.com/watch?v=9KyNVIZxJvI))
This is a bug with `ShortHPBar_CalcPixelFrame` in [engine/battle/anim_hp_bar.asm](/engine/battle/anim_hp_bar.asm):
**Fix:**
**Fix:** Edit `ShortHPBar_CalcPixelFrame` in [engine/battle/anim_hp_bar.asm](/engine/battle/anim_hp_bar.asm):
```diff
ld b, 0
-; This routine is buggy. If [wCurHPAnimMaxHP] * [wCurHPBarPixels] is
-; divisible by HP_BAR_LENGTH_PX, the loop runs one extra time.
-; To fix, uncomment the line below.
.loop
.loop
ld a, l
sub HP_BAR_LENGTH_PX
ld l, a
@ -608,14 +593,11 @@ This is a bug with `ShortHPBar_CalcPixelFrame` in [engine/battle/anim_hp_bar.asm
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 [engine/pokemon/experience.asm](/engine/pokemon/experience.asm):
**Fix:**
**Fix:** Edit `CalcExpAtLevel` in [engine/pokemon/experience.asm](/engine/pokemon/experience.asm):
```diff
CalcExpAtLevel:
; (a/b)*n**3 + c*n**2 + d*n - e
CalcExpAtLevel:
; (a/b)*n**3 + c*n**2 + d*n - e
+ ld a, d
+ cp 1
+ jr nz, .UseExpFormula
@ -628,7 +610,7 @@ CalcExpAtLevel:
+ ld [hl], a
+ ret
+
+.UseExpFormula
+.UseExpFormula
ld a, [wBaseGrowthRate]
add a
add a
@ -643,13 +625,10 @@ CalcExpAtLevel:
([Video](https://www.youtube.com/watch?v=o54VjpAEoO8))
This is a bug with `Text_ABoostedStringBuffer2ExpPoints` and `Text_StringBuffer2ExpPoints` in [data/text/common_2.asm](/data/text/common_2.asm):
**Fix:**
**Fix:** Edit `Text_ABoostedStringBuffer2ExpPoints` and `Text_StringBuffer2ExpPoints` in [data/text/common_2.asm](/data/text/common_2.asm):
```diff
Text_ABoostedStringBuffer2ExpPoints::
Text_ABoostedStringBuffer2ExpPoints::
text_start
line "a boosted"
cont "@"
@ -658,7 +637,7 @@ Text_ABoostedStringBuffer2ExpPoints::
text " EXP. Points!"
prompt
Text_StringBuffer2ExpPoints::
Text_StringBuffer2ExpPoints::
text_start
line "@"
- deciram wStringBuffer2, 2, 4
@ -670,10 +649,7 @@ Text_StringBuffer2ExpPoints::
## BRN/PSN/PAR do not affect catch rate
This is a bug with `PokeBallEffect` in [engine/items/item_effects.asm](/engine/items/item_effects.asm):
**Fix:**
**Fix:** Edit `PokeBallEffect` in [engine/items/item_effects.asm](/engine/items/item_effects.asm):
```diff
-; This routine is buggy. It was intended that SLP and FRZ provide a higher
@ -692,21 +668,18 @@ This is a bug with `PokeBallEffect` in [engine/items/item_effects.asm](/engine/i
ld c, 5
jr nz, .addstatus
ld c, 0
.addstatus
.addstatus
ld a, b
add c
jr nc, .max_1
ld a, $ff
.max_1
.max_1
```
## Moon Ball does not boost catch rate
This is a bug with `MoonBallMultiplier` in [items/item_effects.asm](/items/item_effects.asm):
**Fix:**
**Fix:** Edit `MoonBallMultiplier` in [items/item_effects.asm](/items/item_effects.asm):
```diff
-; Moon Stone's constant from Pokémon Red is used.
@ -724,13 +697,10 @@ This is a bug with `MoonBallMultiplier` in [items/item_effects.asm](/items/item_
## Love Ball boosts catch rate for the wrong gender
This is a bug with `LoveBallMultiplier` in [items/item_effects.asm](/items/item_effects.asm):
**Fix:**
**Fix:** Edit `LoveBallMultiplier` in [items/item_effects.asm](/items/item_effects.asm):
```diff
.wildmale
.wildmale
ld a, d
pop de
@ -743,13 +713,10 @@ This is a bug with `LoveBallMultiplier` in [items/item_effects.asm](/items/item_
## 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):
**Fix:**
**Fix:** Edit `FastBallMultiplier` in [items/item_effects.asm](/items/item_effects.asm):
```diff
.loop
.loop
ld a, BANK(FleeMons)
call GetFarByte
@ -768,21 +735,14 @@ This is a bug with `FastBallMultiplier` in [items/item_effects.asm](/items/item_
*Fixing this bug will break compatibility with standard Pokémon Crystal for link battles.*
This is a bug with `ItemAttributes` in [data/items/attributes.asm](/data/items/attributes.asm):
**Fix:**
**Fix:** Edit `ItemAttributes` in [data/items/attributes.asm](/data/items/attributes.asm):
```diff
; DRAGON_FANG
; DRAGON_FANG
- item_attribute 100, HELD_NONE, 0, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE
+ item_attribute 100, HELD_DRAGON_BOOST, 0, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE
```
And:
```diff
; DRAGON_SCALE
...
; DRAGON_SCALE
- item_attribute 2100, HELD_DRAGON_BOOST, 10, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE
+ item_attribute 2100, HELD_NONE, 10, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE
```
@ -827,13 +787,10 @@ CopyPokemonName_Buffer1_Buffer3:
jp CopyBytes
```
In [data/events/happiness_probabilities.asm](/data/events/happiness_probabilities.asm):
**Fix:**
**Fix:** Edit [data/events/happiness_probabilities.asm](/data/events/happiness_probabilities.asm):
```diff
HappinessData_DaisysGrooming:
HappinessData_DaisysGrooming:
- db $ff, 2, HAPPINESS_GROOMING ; 99.6% chance
+ db $80, 2, HAPPINESS_GROOMING ; 50% chance
+ db $ff, 2, HAPPINESS_GROOMING ; 50% chance
@ -842,13 +799,10 @@ HappinessData_DaisysGrooming:
## Magikarp in Lake of Rage are shorter, not longer
This is a bug with `LoadEnemyMon.CheckMagikarpArea` in [engine/battle/core.asm](/engine/battle/core.asm):
**Fix:**
**Fix:** Edit `LoadEnemyMon.CheckMagikarpArea` in [engine/battle/core.asm](/engine/battle/core.asm):
```diff
.CheckMagikarpArea:
.CheckMagikarpArea:
-; The "jr z" checks are supposed to be "jr nz".
-
-; Instead, all maps in GROUP_LAKE_OF_RAGE (Mahogany area)
@ -875,38 +829,35 @@ This is a bug with `LoadEnemyMon.CheckMagikarpArea` in [engine/battle/core.asm](
## Magikarp length limits have a unit conversion error
This is a bug with `LoadEnemyMon.CheckMagikarpArea` in [engine/battle/core.asm](/engine/battle/core.asm):
**Fix:**
**Fix:** Edit `LoadEnemyMon.CheckMagikarpArea` in [engine/battle/core.asm](/engine/battle/core.asm):
```diff
; Get Magikarp's length
; Get Magikarp's length
ld de, wEnemyMonDVs
ld bc, wPlayerID
callfar CalcMagikarpLength
; No reason to keep going if length > 1536 mm (i.e. if HIGH(length) > 6 feet)
; No reason to keep going if length > 1536 mm (i.e. if HIGH(length) > 6 feet)
ld a, [wMagikarpLength]
- cp HIGH(1536) ; should be "cp 5", since 1536 mm = 5'0", but HIGH(1536) = 6
+ cp 5
jr nz, .CheckMagikarpArea
; 5% chance of skipping both size checks
; 5% chance of skipping both size checks
call Random
cp 5 percent
jr c, .CheckMagikarpArea
; Try again if length >= 1616 mm (i.e. if LOW(length) >= 3 inches)
; Try again if length >= 1616 mm (i.e. if LOW(length) >= 3 inches)
ld a, [wMagikarpLength + 1]
- cp LOW(1616) ; should be "cp 3", since 1616 mm = 5'3", but LOW(1616) = 80
+ cp 3
jr nc, .GenerateDVs
; 20% chance of skipping this check
; 20% chance of skipping this check
call Random
cp 20 percent - 1
jr c, .CheckMagikarpArea
; Try again if length >= 1600 mm (i.e. if LOW(length) >= 2 inches)
; Try again if length >= 1600 mm (i.e. if LOW(length) >= 2 inches)
ld a, [wMagikarpLength + 1]
- cp LOW(1600) ; should be "cp 2", since 1600 mm = 5'2", but LOW(1600) = 64
+ cp 2
@ -916,13 +867,10 @@ This is a bug with `LoadEnemyMon.CheckMagikarpArea` in [engine/battle/core.asm](
## Magikarp lengths can be miscalculated
This is a bug with `CalcMagikarpLength.BCLessThanDE` in [engine/events/magikarp.asm](/engine/events/magikarp.asm):
**Fix:**
**Fix:** Edit `CalcMagikarpLength.BCLessThanDE` in [engine/events/magikarp.asm](/engine/events/magikarp.asm):
```diff
.BCLessThanDE:
.BCLessThanDE:
-; Intention: Return bc < de.
-; Reality: Return b < d.
ld a, b
@ -985,10 +933,7 @@ StartTrainerBattle_DetermineWhichAnimation:
([Video](https://www.youtube.com/watch?v=iHkWubvxmSg))
This is a bug with `_HallOfFamePC.DisplayMonAndStrings` in [engine/events/halloffame.asm](/engine/events/halloffame.asm):
**Fix:**
**Fix:** Edit `_HallOfFamePC.DisplayMonAndStrings` in [engine/events/halloffame.asm](/engine/events/halloffame.asm):
```diff
ld a, [wHallOfFameTempWinCount]
@ -1007,13 +952,10 @@ This is a bug with `_HallOfFamePC.DisplayMonAndStrings` in [engine/events/hallof
([Video](https://www.youtube.com/watch?v=ojq3xqfRF6I))
This is a bug with `Slots_PayoutAnim` in [engine/games/slot_machine.asm](/engine/games/slot_machine.asm):
**Fix:**
**Fix:** Edit `Slots_PayoutAnim` in [engine/games/slot_machine.asm](/engine/games/slot_machine.asm):
```diff
.okay
.okay
ld [hl], e
dec hl
ld [hl], d
@ -1029,10 +971,7 @@ This is a bug with `Slots_PayoutAnim` in [engine/games/slot_machine.asm](/engine
## Team Rocket battle music is not used for Executives or Scientists
This is a bug with `PlayBattleMusic` in [engine/battle/start_battle.asm](/engine/battle/start_battle.asm):
**Fix:**
**Fix:** Edit `PlayBattleMusic` in [engine/battle/start_battle.asm](/engine/battle/start_battle.asm):
```diff
ld de, MUSIC_ROCKET_BATTLE
@ -1051,13 +990,10 @@ This is a bug with `PlayBattleMusic` in [engine/battle/start_battle.asm](/engine
## No bump noise if standing on tile `$3E`
This is a bug with `DoPlayerMovement.CheckWarp` in [engine/overworld/player_movement.asm](/engine/overworld/player_movement.asm):
**Fix:**
**Fix:** Edit `DoPlayerMovement.CheckWarp` in [engine/overworld/player_movement.asm](/engine/overworld/player_movement.asm):
```diff
.CheckWarp:
.CheckWarp:
-; Bug: Since no case is made for STANDING here, it will check
-; [.edgewarps + $ff]. This resolves to $3e at $8035a.
-; This causes wd041 to be nonzero when standing on tile $3e,
@ -1089,13 +1025,12 @@ This is a bug with `DoPlayerMovement.CheckWarp` in [engine/overworld/player_move
([Video](https://www.youtube.com/watch?v=z305e4sIO24))
The exact cause is unknown, but a workaround exists for `DexEntryScreen_MenuActionJumptable.Cry` in [engine/pokedex/pokedex.asm](/engine/pokedex/pokedex.asm):
The exact cause of this bug is unknown.
**Workaround:**
**Workaround:** Edit `DexEntryScreen_MenuActionJumptable.Cry` in [engine/pokedex/pokedex.asm](/engine/pokedex/pokedex.asm):
```diff
.Cry:
.Cry:
- call Pokedex_GetSelectedMon
- ld a, [wd265]
- call GetCryIndex
@ -1134,10 +1069,7 @@ This is a mistake with the left-hand warp carpet corner tiles in [gfx/tilesets/p
This bug prevents you from using blocksets with more than 128 blocks.
In [home/map.asm](/home/map.asm):
**Fix:**
**Fix:** Edit `LoadMetatiles` in [home/map.asm](/home/map.asm):
```diff
; Set hl to the address of the current metatile data ([wTilesetBlocksAddress] + (a) tiles).
@ -1171,10 +1103,7 @@ In [home/map.asm](/home/map.asm):
This bug is why the Lapras in [maps/UnionCaveB2F.asm](/maps/UnionCaveB2F.asm), which uses `SPRITEMOVEDATA_SWIM_WANDER`, is not restricted by its `1, 1` movement radius.
This is a bug with `CanObjectMoveInDirection` in [engine/overworld/npc_movement.asm](/engine/overworld/npc_movement.asm):
**Fix:**
**Fix:** Edit `CanObjectMoveInDirection` in [engine/overworld/npc_movement.asm](/engine/overworld/npc_movement.asm):
```diff
ld hl, OBJECT_FLAGS1
@ -1191,13 +1120,10 @@ This is a bug with `CanObjectMoveInDirection` in [engine/overworld/npc_movement.
This bug can allow you to talk to Eusine in Celadon City and encounter Ho-Oh with only traded legendary beasts.
In [engine/pokemon/search.asm](/engine/pokemon/search.asm):
**Fix:**
**Fix:** Edit `CheckOwnMon` in [engine/pokemon/search.asm](/engine/pokemon/search.asm):
```diff
; check OT
; check OT
-; This only checks five characters, which is fine for the Japanese version,
-; but in the English version the player name is 7 characters, so this is wrong.
@ -1212,7 +1138,7 @@ In [engine/pokemon/search.asm](/engine/pokemon/search.asm):
jr z, .found ; reached end of string
inc hl
inc de
endr
endr
ld a, [de]
cp [hl]
@ -1224,10 +1150,7 @@ endr
This bug can affect Mew or Pokémon other than Ditto that used Transform via Mirror Move or Sketch.
This is a bug with `PokeBallEffect` in [engine/items/item_effects.asm](/engine/items/item_effects.asm):
**Fix:**
**Fix:** Edit `PokeBallEffect` in [engine/items/item_effects.asm](/engine/items/item_effects.asm):
```diff
ld hl, wEnemySubStatus5
@ -1256,7 +1179,7 @@ This is a bug with `PokeBallEffect` in [engine/items/item_effects.asm](/engine/i
ld a, [wEnemyMonDVs + 1]
ld [hl], a
.load_data
.load_data
ld a, [wTempEnemyMonSpecies]
ld [wCurPartySpecies], a
ld a, [wEnemyMonLevel]
@ -1272,13 +1195,10 @@ This is a bug with `PokeBallEffect` in [engine/items/item_effects.asm](/engine/i
([Video](https://www.youtube.com/watch?v=v1ErZdLCIyU))
This is a bug with `PokeBallEffect` in [engine/items/item_effects.asm](/engine/items/item_effects.asm):
**Fix:**
**Fix:** Edit `PokeBallEffect` in [engine/items/item_effects.asm](/engine/items/item_effects.asm):
```diff
.room_in_party
.room_in_party
xor a
ld [wWildMon], a
- ld a, [wCurItem]
@ -1291,10 +1211,7 @@ This is a bug with `PokeBallEffect` in [engine/items/item_effects.asm](/engine/i
## `HELD_CATCH_CHANCE` has no effect
This is a bug with `PokeBallEffect` in [engine/items/item_effects.asm](/engine/items/item_effects.asm):
**Fix:**
**Fix:** Edit `PokeBallEffect` in [engine/items/item_effects.asm](/engine/items/item_effects.asm):
```diff
- ; BUG: farcall overwrites a, and GetItemHeldEffect takes b anyway.
@ -1314,19 +1231,16 @@ This is a bug with `PokeBallEffect` in [engine/items/item_effects.asm](/engine/i
add c
jr nc, .max_2
ld a, $ff
.max_2
.max_2
```
## Only the first three evolution entries can have Stone compatibility reported correctly
This is a bug with `PlacePartyMonEvoStoneCompatibility.DetermineCompatibility` in [engine/pokemon/party_menu.asm](/engine/pokemon/party_menu.asm):
**Workaround (supports up to six entries):**
**Workaround:** Edit `PlacePartyMonEvoStoneCompatibility.DetermineCompatibility` in [engine/pokemon/party_menu.asm](/engine/pokemon/party_menu.asm):
```diff
.DetermineCompatibility:
.DetermineCompatibility:
ld de, wStringBuffer1
ld a, BANK(EvosAttacksPointers)
ld bc, 2
@ -1342,16 +1256,15 @@ This is a bug with `PlacePartyMonEvoStoneCompatibility.DetermineCompatibility` i
call FarCopyBytes
```
This supports up to six entries.
## `EVOLVE_STAT` can break Stone compatibility reporting
This is a bug with `PlacePartyMonEvoStoneCompatibility.DetermineCompatibility` in [engine/pokemon/party_menu.asm](/engine/pokemon/party_menu.asm):
**Fix:**
**Fix:** Edit `PlacePartyMonEvoStoneCompatibility.DetermineCompatibility` in [engine/pokemon/party_menu.asm](/engine/pokemon/party_menu.asm):
```asm
.loop2
.loop2
ld a, [hli]
and a
jr z, .nope
@ -1408,19 +1321,16 @@ ScriptCall:
## `LoadSpriteGFX` does not limit the capacity of `UsedSprites`
In [engine/overworld/overworld.asm](/engine/overworld/overworld.asm):
**Fix:**
**Fix:** Edit `LoadSpriteGFX` in [engine/overworld/overworld.asm](/engine/overworld/overworld.asm):
```diff
LoadSpriteGFX:
LoadSpriteGFX:
-; Bug: b is not preserved, so it's useless as a next count.
-; Uncomment the lines below to fix.
-
ld hl, wUsedSprites
ld b, SPRITE_GFX_LIST_CAPACITY
.loop
.loop
ld a, [hli]
and a
jr z, .done
@ -1431,10 +1341,10 @@ LoadSpriteGFX:
dec b
jr nz, .loop
.done
.done
ret
.LoadSprite:
.LoadSprite:
- ; push bc
+ push bc
call GetSprite
@ -1447,13 +1357,10 @@ LoadSpriteGFX:
## `ChooseWildEncounter` doesn't really validate the wild Pokémon species
In [engine/overworld/wildmons.asm](/engine/overworld/wildmons.asm):
**Fix:**
**Fix:** Edit `ChooseWildEncounter` in [engine/overworld/wildmons.asm](/engine/overworld/wildmons.asm):
```diff
.ok
.ok
ld a, b
ld [wCurPartyLevel], a
ld b, [hl]
@ -1469,10 +1376,7 @@ In [engine/overworld/wildmons.asm](/engine/overworld/wildmons.asm):
## `TryObjectEvent` arbitrary code execution
In [engine/overworld/events.asm](/engine/overworld/events.asm):
**Fix:**
**Fix:** Edit `TryObjectEvent` in [engine/overworld/events.asm](/engine/overworld/events.asm):
```diff
-; Bug: If IsInArray returns nc, data at bc will be executed as code.
@ -1489,7 +1393,7 @@ In [engine/overworld/events.asm](/engine/overworld/events.asm):
ld l, a
jp hl
.nope_bugged
.nope_bugged
- ; pop bc
+ pop bc
xor a
@ -1499,18 +1403,15 @@ In [engine/overworld/events.asm](/engine/overworld/events.asm):
## `ClearWRAM` only clears WRAM bank 1
In [home/init.asm](/home/init.asm):
**Fix:**
**Fix:** Edit `ClearWRAM` in [home/init.asm](/home/init.asm):
```diff
ClearWRAM::
; Wipe swappable WRAM banks (1-7)
; Assumes CGB or AGB
ClearWRAM::
; Wipe swappable WRAM banks (1-7)
; Assumes CGB or AGB
ld a, 1
.bank_loop
.bank_loop
push af
ld [rSVBK], a
xor a

View File

@ -2679,7 +2679,7 @@ TruncateHL_BC:
.finish
ld a, [wLinkMode]
cp 3
cp LINK_COLOSSEUM
jr z, .done
; If we go back to the loop point,
; it's the same as doing this exact

View File

@ -158,11 +158,10 @@ wDisableTextAcceleration:: db
wPreviousLandmark:: db
wCurrentLandmark:: db
wLandmarkSignTimer:: dw
wLinkMode:: ; c2dc
; 0 not in link battle
; 1 link battle
; 4 mobile battle
db
wLinkMode::
; a LINK_* value for the link type
db ; c2dc
wScriptVar:: db ; c2dd