Open
Conversation
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.
Removing the branch saves two bytes.
This file contains hidden or 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
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 7e9e80f: $13 bytes