Skip to content

Fix EAX values being wrong on Linux x64 - #314

Merged
zrax merged 1 commit into
H-uru:masterfrom
dpogue:eax-fixes
Jul 28, 2026
Merged

Fix EAX values being wrong on Linux x64#314
zrax merged 1 commit into
H-uru:masterfrom
dpogue:eax-fixes

Conversation

@dpogue

@dpogue dpogue commented Jul 27, 2026

Copy link
Copy Markdown
Member

On x64 Windows with MSVC, long is 32-bits, but on other x64 systems, long is 64-bits. When these values in the EAXPARAMETERS structure are populated, a 32-bit unsigned int is read from the stream and cast to the structure member type. Because these are defined as long this means that some values that are intended to be 32-bit signed numbers are getting interpreted as 32-bit unsigned numbers because of expansion to the 64-bit member type.

Comment thread core/PRP/Audio/plEAXStructures.h Outdated
typedef struct _EAXREVERBPROPERTIES
{
unsigned long ulEnvironment;
unsigned int ulEnvironment;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If these need to be a specific size, we should probably use uint32_t etc. instead.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

That's what I was originally thinking, but it seems like the bulk of libHSPlasma doesn't use stdint types. I'm definitely happy to switch it over if that's what we prefer

@Hoikas Hoikas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The getters and setters also need to be updated in PyHSPlasma to match.

On x64 Windows with MSVC, `long` is 32-bits, but on other x64 systems,
`long` is 64-bits. When these values in the EAXPARAMETERS structure are
populated, a 32-bit unsigned int is read from the stream and cast to the
structure member type. Because these are defined as `long` this means
that some values that are intended to be 32-bit signed numbers are
getting interpreted as 32-bit unsigned numbers because of expansion to
the 64-bit member type.
@dpogue

dpogue commented Jul 27, 2026

Copy link
Copy Markdown
Member Author

Updated to use stdint types and ensured the Python bindings match the new types.

@zrax
zrax merged commit bdf9209 into H-uru:master Jul 28, 2026
8 checks passed
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.

4 participants