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

Improve SAS ADSR rates and types #5361

Merged
merged 4 commits into from
Feb 8, 2014
Merged

Conversation

unknownbrackets
Copy link
Collaborator

This does not actually affect the envelope calculation, just the initial values as set by the __sceSasSetSimpleADSR() func and validations for the other two __sceSasSetADSR*() funcs.

The simple bitfields were not being parsed entirely correctly. Final Fantasy Tactics, at least, hits basically all of these cases. I don't have a good ear for it, but this may possibly improve some of its sound effects. It could also affect games hanging, since a couple cases produced negative or 0 rates incorrectly.

This passes some in-progress tests I have, but they depend on the sceSas struct being written properly, which I'm still not ready with.

Also adds reporting for the "Every Extend Extra" case which I can't reproduce returning success. Worried this could break things, does anyone have Every Extend Extra to verify it calls it this way still (I see from blame history that this was quite a long time ago)?

@gid15 I believe the "simple ADSR" bit stuff came from JPCSP. I checked really quick and AFAICT it's incorrect per these changes / my tests. Just FYI.

-[Unknown]

They were wrong for a few combinations before.  Could have effected how
accurate sound effects were (they may have been too quite, or dropped off
wrong, etc.)
Might happen due to a bug in a game, rejected by real firmware.
Might prevent a game bug from breaking sounds, pretty unlikely.
if (voiceNum >= PSP_SAS_VOICES_MAX || voiceNum < 0) {
WARN_LOG(SCESAS, "%s: invalid voicenum %d", __FUNCTION__, voiceNum);
return ERROR_SAS_INVALID_VOICE;
}
// Create a mask like flag for the invalid values.
int invalid = (a < 0 ? 0x1 : 0) | (a < 0 ? 0x1 : 0) | (s < 0 ? 0x1 : 0) | (r < 0 ? 0x1 : 0);
Copy link
Owner

Choose a reason for hiding this comment

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

Hm, there are some typos on this line. Not only is 'a' checked twice, but you set all the bits to 0x1 - I would have expected you to use 0x1, 0x2, 0x4, 0x8 for example.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Duh, sorry. My test probably should've tested each case individually.

-[Unknown]

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.

None yet

2 participants