Skip to content

reimplement: SHC_3BB0A8C1_0x0047B590 100%#124

Draft
TheRedDaemon wants to merge 1 commit into
mainfrom
reimpl/SHC_3BB0A8C1_0x0047B590
Draft

reimplement: SHC_3BB0A8C1_0x0047B590 100%#124
TheRedDaemon wants to merge 1 commit into
mainfrom
reimpl/SHC_3BB0A8C1_0x0047B590

Conversation

@TheRedDaemon

Copy link
Copy Markdown
Contributor

Yep, once again full circle:
I suggest to remove the UnkSoundFlagsAndLoopCount as value type completely and instead try to use bit operations.
This function here basically consists out of nothing and assuming there are no weird optimizations related to knowing the called functions, only plain values produce the required order.
The only other way would be compiler differences, but these have lesser probability.

That being said, I would prefer if we could use some constants/macros for this with specific names. These here in the PR are only examples. I am open for better suggestions.

@TheRedDaemon TheRedDaemon requested a review from gynt June 20, 2026 21:29
@TheRedDaemon TheRedDaemon added the declaration/type change This requires changes to the generated/exported types or definitions. label Jun 20, 2026
int unknownFlag2 : 1;
int uninterruptable : 1;

static unsigned int const LOOP_COUNT_FIELD = 0x0000FFFF;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What about dropping UnkSoundFlagsAndLoopCount altogether in favor of an int, and move these to an enum. So then in function bodies you can rely on the enum entries to do the manipulations.

int loopCountFieldPart = value & LOOP_COUNT_FIELD;
int uninterruptible = value | UNINTERRUPTABLE;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I was thinking about an enum, but I am not really sure if this properly conveys the mixture of flags and a value. At the moment I am also scared that the enum might have yet other effects, even if this seems unlikely so far.
But we could try? Even if it turns out it is once again a problem, we could then just change it to constants.

I will try to finish the methods of SoundSystem and then experiment with the remaining non-fitting functions.
Types is also some of the last things I could try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

declaration/type change This requires changes to the generated/exported types or definitions.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants