Putting an end to memes like SetSecondaryMemory setting a field called "working_memory."
I'm very confident about the size/offsets of fields in these new structs being correct. I'm not 100% on some of the names though, because I don't understand the full context of $89D4 entries and just blindly copied some names figured out by @CataLatas.
I didn't want to touch anything other than the window_stats struct itself since I was already making things way too big with the docs in the second commit (sorry), but some other stuff that was learned from making this PR:
WINDOW_EXISTENCE_TABLE+106 and onward seem to be separate variables from the existence table. EarthBound only has windows with IDs 0 thru 52.
UNKNOWN_7E88E0 and UNKNOWN_7E88E2 are the head and tail indexes, respectively, of a double-linked list of window_statses ($88E0 is the index of the first window opened, $88E2 of the last window opened). Not sure how that interacts with the window focus system, since CURRENT_FOCUS_WINDOW is a separate thing...
The MOVE_CURSOR function has some inconsistent stuff going on with stack arguments, it seems. I assume 7BFFFF is supposed to be two 16-bit arguments instead of one 32-bit argument? Didn't dig into it to find out
Both builds are working right now, I'll re-test them after I fix merge conflicts.
re: point 3, it's possible. I used a regex to find all code matching an LDA #$xxxx / STA $Y / LDA #$xxxx / STA $Y+2 pattern, that may have been a false positive
Putting an end to memes like SetSecondaryMemory setting a field called "working_memory."
I'm very confident about the size/offsets of fields in these new structs being correct. I'm not 100% on some of the names though, because I don't understand the full context of $89D4 entries and just blindly copied some names figured out by @CataLatas.
I didn't want to touch anything other than the window_stats struct itself since I was already making things way too big with the docs in the second commit (sorry), but some other stuff that was learned from making this PR:
WINDOW_EXISTENCE_TABLE+106
and onward seem to be separate variables from the existence table. EarthBound only has windows with IDs 0 thru 52.UNKNOWN_7E88E0
andUNKNOWN_7E88E2
are the head and tail indexes, respectively, of a double-linked list ofwindow_stats
es ($88E0 is the index of the first window opened, $88E2 of the last window opened). Not sure how that interacts with the window focus system, sinceCURRENT_FOCUS_WINDOW
is a separate thing...MOVE_CURSOR
function has some inconsistent stuff going on with stack arguments, it seems. I assume 7BFFFF is supposed to be two 16-bit arguments instead of one 32-bit argument? Didn't dig into it to find outBoth builds are working right now, I'll re-test them after I fix merge conflicts.