diff options
| author | Rangi <remy.oukaour+rangi42@gmail.com> | 2019-02-16 13:31:23 -0500 | 
|---|---|---|
| committer | Rangi <remy.oukaour+rangi42@gmail.com> | 2019-02-16 13:31:23 -0500 | 
| commit | 96bcf72d96cf59e3e1f5aaefb9b62b5e9b154e18 (patch) | |
| tree | 2a7f64e3afc5be75fb256361eef3f0cabad7d22d /docs | |
| parent | 771d2efd6569036531d69cf79d9b5aa163341cfc (diff) | |
Document the BattleAnimCmd_ClearObjs bug
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/bugs_and_glitches.md | 20 | 
1 files changed, 20 insertions, 0 deletions
| diff --git a/docs/bugs_and_glitches.md b/docs/bugs_and_glitches.md index 93c759915..df7790b1b 100644 --- a/docs/bugs_and_glitches.md +++ b/docs/bugs_and_glitches.md @@ -68,6 +68,7 @@ Fixes are written in the `diff` format. If you've used Git before, this should l  - [`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)  - [`ClearWRAM` only clears WRAM bank 1](#clearwram-only-clears-wram-bank-1) +- [`BattleAnimCmd_ClearObjs` only clears the first 6⅔ objects](#battleanimcmd_clearobjs-only-clears-the-first-6⅔-objects)  ## Thick Club and Light Ball can make (Special) Attack wrap around above 1024 @@ -1585,3 +1586,22 @@ This supports up to six entries.  +	jr c, .bank_loop   	ret  ``` + + +## `BattleAnimCmd_ClearObjs` only clears the first 6⅔ objects + +**Fix:** Edit `BattleAnimCmd_ClearObjs` in [engine/battle_anims/anim_commands.asm](/engine/battle_anims/anim_commands.asm): + +```diff + BattleAnimCmd_ClearObjs: +-; BUG: This function only clears the first 6⅔ objects + 	ld hl, wActiveAnimObjects +-	ld a, $a0 ; should be NUM_ANIM_OBJECTS * BATTLEANIMSTRUCT_LENGTH +-	ld a, NUM_ANIM_OBJECTS * BATTLEANIMSTRUCT_LENGTH + .loop + 	ld [hl], 0 + 	inc hl + 	dec a + 	jr nz, .loop + 	ret +``` | 
