Repository navigation
Port: fix the dungeon minimap and lock-on disappearing after the item overflow screen - #139
Merged
Conversation
… overflow screen CMenuItemInfo::KeyStep clears TrushMesCls[i] for i < 8 when the item menu's overflow notice closes, but the table has 4 entries (0x10 bytes in the PAL symbol map). On the PS2 the extra writes landed in the start of MenuItemMainMemory. On the host the 4 pointers past the end are the next statics, starting with dng_main.cpp's debag_param, so after the overflow screen the dungeon stopped drawing the mini map, the lock-on and the damage numbers until the next floor. The unit copy now declares eight slots, which stay null, like DownLoadMes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the minimap and enemy lock-on disappearing in dungeons after going through the item overflow screen. I ran into this while playing: my bag was full, I picked up an item, sorted it out on the overflow screen, and the minimap and lock-on were gone until the next floor. The status bar still showed up fine.
Before opening the chest (minimap in the top right):

The overflow screen. Closing this notice is what breaks it:

After closing the overflow screen on master:

Same spot with this change:

Before: when the item menu opens with stuff in the overflow slots it shows a notice about it. Closing that notice (
CMenuItemInfo::KeyStep,ps2/src/menusys.cpp:11818) setsTrushMesCls[i]to NULL fori < 8, butTrushMesClsonly has 4 entries. The PAL symbol map has it at 0x10 bytes too, so this is a retail bug. On PS2 the extra writes land at the start ofMenuItemMainMemoryinstead. On PC the pointers are twice as big and different statics come after it. On Windows the first one isdebag_paramfrom dng_main.cpp.DngMainDrawskips the minimap, lock-on, monster names and damage numbers while that's 0, and nothing turns it back on untilInitDungeonMainruns for the next floor.After: a unit fixup makes the PC copy of
TrushMesCls8 entries so the loop stays in bounds. The extra 4 are never used. It's the same thing that was done forDownLoadMesin editmenu.cpp. The PS2 source isn't touched.Tests:
test_trash_message_reset_stays_inside_its_slotstoscripts/port/test_header_fixups.py. It fails without the fixup.Sound.SecondLoadReplacesTheBanks, which failed once with -j8 and passes when run on its own.--giveto fill the bag so the first chest on Underground Channel floor 1 goes to overflow. After closing the overflow screen the minimap is gone on master and still there with this change.