diff options
author | Rangi <remy.oukaour+rangi42@gmail.com> | 2020-12-07 13:32:08 -0500 |
---|---|---|
committer | Rangi <remy.oukaour+rangi42@gmail.com> | 2020-12-07 13:32:08 -0500 |
commit | 098903fc971fdb4fbaec1c72de2b6b2414c5ad90 (patch) | |
tree | a33453b37aa91e918a580680805f6a3563cbddb2 /docs | |
parent | 4ef556cbc83659683454f0bf4415af52e4371d56 (diff) |
FarString -> PlaceFarString, and document a BrokenPlaceFarString bug
Diffstat (limited to 'docs')
-rw-r--r-- | docs/bugs_and_glitches.md | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/docs/bugs_and_glitches.md b/docs/bugs_and_glitches.md index 93a458082..b7873bc05 100644 --- a/docs/bugs_and_glitches.md +++ b/docs/bugs_and_glitches.md @@ -84,6 +84,7 @@ Fixes in the [multi-player battle engine](#multi-player-battle-engine) category - [Magikarp lengths can be miscalculated](#magikarp-lengths-can-be-miscalculated) - [`CheckOwnMon` only checks the first five letters of OT names](#checkownmon-only-checks-the-first-five-letters-of-ot-names) - [`CheckOwnMonAnywhere` does not check the Day-Care](#checkownmonanywhere-does-not-check-the-day-care) + - [The unused `phonecall` script command may crash](#the-unused-phonecall-script-command-may-crash) - [Internal engine routines](#internal-engine-routines) - [Saves corrupted by mid-save shutoff are not handled](#saves-corrupted-by-mid-save-shutoff-are-not-handled) - [`ScriptCall` can overflow `wScriptStack` and crash](#scriptcall-can-overflow-wscriptstack-and-crash) @@ -2026,6 +2027,28 @@ This bug can prevent you from talking to Eusine in Celadon City or encountering ``` +### The unused `phonecall` script command may crash + +The `phonecall` script command calls the `PhoneCall` routine, which calls the `BrokenPlaceFarString` routine; this switches banks without being in bank 0, so it would start running arbitrary data as code. + +**Fix:** Edit `PhoneCall.CallerTextboxWithName` in [engine/phone/phone.asm](https://github.com/pret/pokecrystal/blob/master/engine/phone/phone.asm): + +```diff +- ld a, [wPhoneScriptBank] +- ld b, a + ld a, [wPhoneCaller] + ld e, a + ld a, [wPhoneCaller + 1] + ld d, a +- call BrokenPlaceFarString ++ ld a, [wPhoneScriptBank] ++ call PlaceFarString + ret +``` + +You can also delete the now-unused `BrokenPlaceFarString` routine. + + ## Internal engine routines |