diff --git a/docs/bugs_and_glitches.md b/docs/bugs_and_glitches.md index 35aa36850..bda8bccad 100644 --- a/docs/bugs_and_glitches.md +++ b/docs/bugs_and_glitches.md @@ -2019,103 +2019,7 @@ This bug can prevent you from talking to Eusine in Celadon City or encountering ([Video 1](https://www.youtube.com/watch?v=ukqtK0l6bu0), [Video 2](https://www.youtube.com/watch?v=c2zHd1BPtvc)) -**Fix:** Edit `MoveMonWOMail_InsertMon_SaveGame` and `_SaveGameData` in [engine/menus/save.asm](https://github.com/pret/pokecrystal/blob/master/engine/menus/save.asm): - -```diff - MoveMonWOMail_InsertMon_SaveGame: - ... - ld a, TRUE - ld [wSaveFileExists], a - farcall StageRTCTimeForSave - farcall BackupMysteryGift -- call ValidateSave -+ call InvalidateSave - call SaveOptions - call SavePlayerData - call SavePokemonData - call SaveChecksum -- call ValidateBackupSave -+ call ValidateSave -+ call InvalidateBackupSave - call SaveBackupOptions - call SaveBackupPlayerData - call SaveBackupPokemonData - call SaveBackupChecksum -+ call ValidateBackupSave - farcall BackupPartyMonMail - farcall BackupMobileEventIndex - farcall SaveRTC - ... -``` - -```diff - _SaveGameData: - ... - ld a, TRUE - ld [wSaveFileExists], a - farcall StageRTCTimeForSave - farcall BackupMysteryGift -- call ValidateSave -+ call InvalidateSave - call SaveOptions - call SavePlayerData - call SavePokemonData - call SaveBox - call SaveChecksum -- call ValidateBackupSave -+ call ValidateSave -+ call InvalidateBackupSave - call SaveBackupOptions - call SaveBackupPlayerData - call SaveBackupPokemonData - call SaveBackupChecksum -+ call ValidateBackupSave - call UpdateStackTop - farcall BackupPartyMonMail - farcall BackupMobileEventIndex - farcall SaveRTC - ... -``` - -Then create two new routines, `InvalidateSave` and `InvalidateBackupSave`: - -```diff - ValidateSave: - ld a, BANK(sCheckValue1) ; aka BANK(sCheckValue2) - call OpenSRAM - ld a, SAVE_CHECK_VALUE_1 - ld [sCheckValue1], a - ld a, SAVE_CHECK_VALUE_2 - ld [sCheckValue2], a - jp CloseSRAM - -+InvalidateSave: -+ ld a, BANK(sCheckValue1) ; aka BANK(sCheckValue2) -+ call OpenSRAM -+ xor a -+ ld [sCheckValue1], a -+ ld [sCheckValue2], a -+ jp CloseSRAM -``` - -```diff - ValidateBackupSave: - ld a, BANK(sBackupCheckValue1) ; aka BANK(sBackupCheckValue2) - call OpenSRAM - ld a, SAVE_CHECK_VALUE_1 - ld [sBackupCheckValue1], a - ld a, SAVE_CHECK_VALUE_2 - ld [sBackupCheckValue2], a - jp CloseSRAM - -+InvalidateBackupSave: -+ ld a, BANK(sBackupCheckValue1) ; aka BANK(sBackupCheckValue2) -+ call OpenSRAM -+ xor a -+ ld [sBackupCheckValue1], a -+ ld [sBackupCheckValue2], a -+ jp CloseSRAM -``` +This does not have a simple and accurate fix. It would involve redesigning parts of the save system for Pokémon boxes. ### `ScriptCall` can overflow `wScriptStack` and crash