-
Notifications
You must be signed in to change notification settings - Fork 16
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
SPC-Side Optimization Collection 2 #412
Open
KungFuFurby
wants to merge
13
commits into
master
Choose a base branch
from
spc-side-optimizations
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Six bytes are saved. One is saved by consolidating setting !MusicNoiseChannels and $0389 into a Noiz subroutine, but only with !noSFX set to !false. The other five are saved by recycling VCMD $F8's code. !noSFX gets a different saving: namely, by getting rid of a redundant set of !MusicNoiseChannels, because VCMD $F8's code does the job instead, and it's never skipped since the SFX check naturally does not exist.
By taking advantage of the accumulator and recycling a call to KeyOffVoices (though we skip clearing !PlayingVoices), we save two bytes. This one (and a missed optimization) was also ported to the old unpause silent SFX ASM that was kept for historical reasons and also to act as an example.
This does the same thing as checking for a zero in Y. The accumulator is overwritten, but we're not really using it afterwards, so we save a byte.
Y is already zero in the first place, so we save a byte by doing this.
… echo RAM This saves four bytes.
This saves two bytes.
Set these prior to performing the ID comparisons for ProcessAPU1SFX. Saves ten bytes in the process, but they're only saved for the hardcoded 1DFA SFX.
Another three bytes saved by doing this, but again, only for hardcoded 1DFA SFX.
14 tasks
This does the same thing as checking for a zero in Y. The accumulator is overwritten, but we're not really using it afterwards, so we save a byte.
Calling L_09CD then jumping to pitch is already handled by the main SFX code, and jumping there saves three bytes for the hardcoded SFX.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
AddmusicK 1.0.10 will currently not be taking in these optimizations to avoid accidental regressions. However, these optimizations are going to be here to track bytes saved for future accommodations of any additional SPC-side code that will be included by default.
Number of bytes saved so far for the default build as of 8720e27: $11 bytes