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

Add global volume fade #298

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Add global volume fade #298

wants to merge 9 commits into from

Conversation

KungFuFurby
Copy link
Owner

(Initially) directly ported from my contribution to YoshiFanatic's AddmusicK for Super Mario All Stars + Super Mario World.

This commit closes #95.

This is my earliest modification made to the AddmusicK sound driver for Super
Mario All-Stars and Super Mario World: adding a custom global volume fade.

This is my original changelog entry that goes with this code (initially inserted
into the top of main.asm):
4/23/20
- Corrected a conflict with the master volume when handling fades.
- Added support for fading to any volume value through the SNES.
  $FF will fade out with the exact same purpose as before.
4/24/20
- Accidentally forgot to account for master volume fade's usage of the
  variables when handling fades.
5/28/20
- Modified global volume to use $FF as a maximum instead of $F0
  The multiplication values are now $11, instead of $10, so that
  the maximum value can be achieved via a max target volume.
There are some conflicts value-wise if there are more than 127 songs, but this
will kind of ensure that things move alongs smoothly. However, I will recommend
direct storages to $2142 to get these working quicker.
@KungFuFurby KungFuFurby added spc-side Involves the SPC700 code. snes-side Involves the 65816 code. May or may not be specific to Super Mario World. labels Jun 3, 2022
This is the code I originally removed because of a conflict with the music
VCMDs.
Due to RPGHacker/asar#245 , some ANDing has to be done
in order to avoid getting an out of range error in the first pass, which causes
the phantom error in the first place.
$F0 is a leftover from when I set the maximum to that value instead of $FF. It
was corrected so that the volume of the song would default to not being modified
at all.
Partially cherry picked off of commit e026687 .
…code

These can now properly detect out of range errors as of asar 1.90 without
silently failing. Therefore, the bug circumnavigation measures are no longer
needed in order to avoid breaking the SPC side during playback.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
snes-side Involves the 65816 code. May or may not be specific to Super Mario World. spc-side Involves the SPC700 code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement global volume fade
1 participant