StageSelect: Difference between revisions

From ZeldaMods (Breath of the Wild)
Jump to navigation Jump to search
imported>Leoetlino
(Created page with "'''StageSelect''' (uking::StageSelect) is a development-only feature that allows the user to select and load a stage directly. In release builds, code for the stage select sc...")
 
imported>Leoetlino
No edit summary
 
Line 5: Line 5:
* When [[GameScene]] constructs uking::StageSelect<ref>0x71007B1200 in Switch 1.5.0</ref>, a nullptr heap is passed to it because the code that would normally create the StageSelect heap is no longer present.  
* When [[GameScene]] constructs uking::StageSelect<ref>0x71007B1200 in Switch 1.5.0</ref>, a nullptr heap is passed to it because the code that would normally create the StageSelect heap is no longer present.  
* The list of stages the user can choose from is loaded from a subsystem that is missing from release executables<ref>The instance pointer for that subsystem is stored at 0x00000071025CE6D8 in .bss. It is never written to.</ref>. When StageSelect is initialized, it attempts to access the global subsystem instance<ref>0x71007CD4DC</ref>, which promptly causes the game to dereference a null pointer and crash.
* The list of stages the user can choose from is loaded from a subsystem that is missing from release executables<ref>The instance pointer for that subsystem is stored at 0x00000071025CE6D8 in .bss. It is never written to.</ref>. When StageSelect is initialized, it attempts to access the global subsystem instance<ref>0x71007CD4DC</ref>, which promptly causes the game to dereference a null pointer and crash.
* Revision information (i.e. versions, build info, etc.) will not show up properly because the Revision subsystem is also stubbed in release builds. Moreover because Revision is not initialized at all when not in debug mode<ref>0x7100F3ADC8</ref> the game will also crash as it tries to dereference nullptr.
* Revision information (i.e. versions, build info, etc.) will not show up properly because the Revision subsystem is also stubbed in release builds. Moreover, the game will also crash when it tries to dereference Revision::sInstance, as Revision is not initialized at all when not in debug mode<ref>0x7100F3ADC8</ref>.
* The game attempts to use the SeadMenu subsystem, which also does not exist anymore in release builds<ref>SeadMenu::sInstance @ 0x00000071025F8A88 (.bss) is never set.</ref>
* The game attempts to use the SeadMenu subsystem, which also does not exist anymore in release builds<ref>SeadMenu::sInstance @ 0x00000071025F8A88 (.bss) is never set.</ref>



Latest revision as of 17:54, 15 November 2018

StageSelect (uking::StageSelect) is a development-only feature that allows the user to select and load a stage directly.

In release builds, code for the stage select screen is still present in the executable to a certain extent; however its functionality is entirely unused. Furthermore, it is completely broken because of the following reasons:

  • When GameScene constructs uking::StageSelect[1], a nullptr heap is passed to it because the code that would normally create the StageSelect heap is no longer present.
  • The list of stages the user can choose from is loaded from a subsystem that is missing from release executables[2]. When StageSelect is initialized, it attempts to access the global subsystem instance[3], which promptly causes the game to dereference a null pointer and crash.
  • Revision information (i.e. versions, build info, etc.) will not show up properly because the Revision subsystem is also stubbed in release builds. Moreover, the game will also crash when it tries to dereference Revision::sInstance, as Revision is not initialized at all when not in debug mode[4].
  • The game attempts to use the SeadMenu subsystem, which also does not exist anymore in release builds[5]

Restoring its functionality is technically possible but difficult.

  1. 0x71007B1200 in Switch 1.5.0
  2. The instance pointer for that subsystem is stored at 0x00000071025CE6D8 in .bss. It is never written to.
  3. 0x71007CD4DC
  4. 0x7100F3ADC8
  5. SeadMenu::sInstance @ 0x00000071025F8A88 (.bss) is never set.