Closed UsernameFodder closed 11 months ago
Wow, this is very detailed! Imagine creating custom menus with ASM patches. It could be used to add new in-game config options, which is something I always thought would be cool for patches (no need to configure them when applying the patch, you would be able to change the settings in-game).
Just the other day, during my last info dump, I was checking if we had any structs with flags that are passed to menus, because PlayMenuOptionSound
contains this check the start of the function: if [r0+0x10] & 0x10 == 0, return
. Seems like one of the flags might be used to silence menu sounds.
Wow, this is very detailed! Imagine creating custom menus with ASM patches. It could be used to add new in-game config options, which is something I always thought would be cool for patches (no need to configure them when applying the patch, you would be able to change the settings in-game).
Just the other day, during my last info dump, I was checking if we had any structs with flags that are passed to menus, because
PlayMenuOptionSound
contains this check the start of the function:if [r0+0x10] & 0x10 == 0, return
. Seems like one of the flags might be used to silence menu sounds.
Glad I'm not the only one that sees potential here. Though, I'm not sure how usable this stuff is for patching in its current state, seeing as there's still a lot of missing info. Probably needs more research before it really becomes powerful.
Thanks, all this new documentation will be really useful. If you need some examples for custom advanced menus, refer to https://github.com/tech-ticks/strung-up-by-patches (e.g. the Ether in https://github.com/tech-ticks/strung-up-by-patches/blob/main/src/item_effects.c). I think most (or all) structs and functions are already documented here, but it might help understand which calls are required for a working menu.
Unifies menus, dboxes, and portrait boxes into a single generic graphical window system. The central object in this system is the "window", which can be specialized into menus, text boxes, portraits, and more.
On top of the previously known specializations, these additions identify many more window types. The full list (see window.h comments for in-game examples of the more esoteric types):
The above list of window types should hopefully be exhaustive. They were tracked down by looking at all callers to the NewWindowScreenCheck function across all binaries, which also reveal the update function and the size of the contents structure stored in struct window_params. By looking at the update function pointer addresses in active windows in the WINDOW_LIST, and twiddling some data to observe live changes, it's possible to correlate different update functions with examples, which in turn allows the general purpose of each window type to be inferred.
All windows share similar APIs for general manipulation (though each type may have additional specialized methods, which remain mostly undocumented):
As part of unification under the generic window system, some old terminology has been changed. Among the most important:
struct dbox_layout
has been renamed tostruct window_params