Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Information regarding sound playback #19

Open
WizzardMaker opened this issue Feb 11, 2022 · 1 comment
Open

Information regarding sound playback #19

WizzardMaker opened this issue Feb 11, 2022 · 1 comment

Comments

@WizzardMaker
Copy link
Collaborator

I already RE a bit of the sound system

The "PlaySound" method is at S4_Main + 0x10C390
Arguments seem to be:

arg1(ecx) - SoundSystem*
arg2(esi)  - Debug related string - seems to be always nullptr
arg3 - Sound Id
arg4 - possibly volume
arg5 - sound effect panning maybe (A high value played a sound on the right channel) - seems to point at the first variable in the SoundSystem struct
arg6 - Again a pointer to the SoundSystem*
arg7 - Unknown, seems to always be 0

The global SoundSystem* is at S4_Main + 0x10540C4

Other findings regarding sound and music:

MusicVolume = (DWORD*)(S4_Main + 0xDB596C);
MusicToggle = (DWORD*)(S4_Main + 0xDB5978);

SoundVolume = (DWORD*)(S4_Main + 0xDB5984);
SoundToggle = (DWORD*)(S4_Main + 0xDB5990);

SetMusicVolume Method at S4_Main + 0x10C4A0
SetSoundVolume Method at S4_Main + 0x10C500
Both need a reference to the SoundSystem* at 0x10540C4 on ecx.
@WizzardMaker
Copy link
Collaborator Author

WizzardMaker commented Feb 11, 2022

Sound Ids that I've found:

//UI:
BUTTON_CLICK = 7;
BUTTON_RELEASE_NOT_ACTIVATE = 6; //Happens when you move away from a button without activating it
//Ingame:
HAMMER_HIT = 5;

Variations of Sound Effects are baked into an ID, with 5 being a good example. Playing the same ID multiple times gives different sound samples of the same type

Okay, just found out about every ID. Clear names are at S4_Main + 0xC15374

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

No branches or pull requests

1 participant