Skip to content

main, field: main function, more field functions and splits - #172

Merged
Xeeynamo merged 8 commits into
Xeeynamo:mainfrom
Zaarbs:field-work
Sep 17, 2026
Merged

Xeeynamo merged 8 commits into
Xeeynamo:mainfrom
Zaarbs:field-work

Conversation

@Zaarbs

@Zaarbs Zaarbs commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Matching main(), .rodata for 14C70.c corrected so it includes the block of arrays used by functions in that TU.

field_entity.c TU identified from PC port and split out. Most of the functions decompiled based on PC equivalents. NON_MATCHINGS functions in field.c have .rodata alignment issues and need to be split into separate TU before they match. FieldMain and FieldMainLoop have some odd casts and temps because one of them reading a volatile member from g_FieldState also affect the other. They need a bit of further cleanup after decomping more functions to figure out the volatility of more FieldState members.

@Xeeynamo Xeeynamo left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skimmed through it. This is a very high quality PR. Great work!!

Comment thread include/psxsdk/libetc.h
#define MOUSEright (1 << 2)

// scratch pad address 0x1f800000 - 0x1f800400
#define getScratchAddr(offset) ((u_long *)(0x1f800000+offset*4))

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a heads-up: I might change this to something like this in the future: https://github.com/Xeeynamo/sotn-decomp/blob/master/include/scratchpad.h#L22

Comment thread include/game.h
GAMESTATE_MENU_COMMANND = 13, // Commands called from field to menus
GAMESTATE_SNOWBOARD2 = 14,
GAMESTATE_LOAD_INSTR2 = 16, // Load instrument bank for One-Winged Angel
} GameState;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool, thanks!

@Xeeynamo
Xeeynamo merged commit 45f7c15 into Xeeynamo:main Sep 17, 2026
2 checks passed
@Zaarbs
Zaarbs deleted the field-work branch September 17, 2026 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants