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 some VCMD filtering options #85

Open
1 of 15 tasks
KungFuFurby opened this issue Apr 2, 2021 · 0 comments · May be fixed by #212
Open
1 of 15 tasks

Add some VCMD filtering options #85

KungFuFurby opened this issue Apr 2, 2021 · 0 comments · May be fixed by #212
Labels
enhancement New feature or request partially-resolved Something that partially resolves the issue (or part of the pull request itself) was merged. spc-side Involves the SPC700 code.

Comments

@KungFuFurby
Copy link
Owner

KungFuFurby commented Apr 2, 2021

Going off of #32, #57 (and with a pre-existing P-Switch code filtering option), I think there should be some VCMD filtering options for filesize reasons. All of the new code that is being added on to the sound driver pushes up the filesize. When a filter is applied, all other code is also changed to reflect the absence of the feature in question.

Note that auto-detection may or may not be included with this: it would require that the hex VCMDs are validated for a start, and it gets more complex with entire soundtrack's worth of songs to analyze. Also, it is important that the VCMD in question is actually safe to filter out: if it isn't safe to filter out unless it is completely unused, then if it is included here, it will force a second compilation pass if it is ever used. This specifically would affect the subroutine ($E9) and repeat section ($E6) VCMDs for a start, but the custom ASM and jump VCMDs (see #65 and #106) are also involved.

The ones running through my head are...

  • Echo. This will also permanently disable echo writes, since the echo buffer is no longer needed.
  • Yoshi Drums. These are channel-muting cases, and if the feature is not needed, then these are also not needed.
  • Special Pulse Wave (requires that Restore Special Wave from AddMusicM #38 be merged first)
  • Noise. Does not affect SFX. When noise VCMDs are cut from music, then the noise frequency conflict code between music and SFX is also rendered null and void.
  • Pitch Modulation
  • Arpeggio
  • Remote Commands
  • SNES Sync Clock
  • Vibrato
  • Tremolo
  • Pitch bends. Will have to double check between music and SFX, though...
  • Panning and/or phase inversion. Some N-SPC variants actually didn't support the latter.
    • This actually de-facto leads into giving this sound driver mono and/or psuedo-surround support like how some other sound drivers implemented this kind of support (though usually only for mono/stereo).
  • Velocity Table, particularly if only one is used.
  • Hot Patch Bits

If enough of these VCMD IDs are dummied out, then using a jump array would actually cost more memory than checking values individually. I will never do this for the main VCMD table, but for the $F4 and $FA VCMDs, this is more plausible for me to do. I can even conjure up an algebra formula for asar to use, and have AddmusicK manually generate two key values in order to determine which one to use:

  • Maximum VCMD ID
  • Number of blank slots

Roughly speaking, it's equivalent to 2x+y = 4x-4z (left side uses a code pointer array, right side checks values individually), where...

  • x is the maximum VCMD ID.
  • y is the number of bytes to code in the pointer table reference routine.
  • z is the number of blank VCMD slots. This is needed because each one sub

Ties favor the code pointer array due to consuming less opcodes.

@KungFuFurby KungFuFurby added enhancement New feature or request spc-side Involves the SPC700 code. labels Apr 2, 2021
KungFuFurby added a commit that referenced this issue Sep 13, 2021
These macros are going to come in handy when VCMD filtering is implemented in
the upcoming commits.

This commit mentions #85.
KungFuFurby added a commit that referenced this issue Sep 13, 2021
Arpeggio takes up a good chunk of memory to implement, and until AddmusicK 1.0.9
(RC), it wasn't very functional, either. Thus, by setting !noVcmdFB to !true,
the code will be removed from the sound driver on compilation.

Please note that pass-through code has not been properly programmed in yet, so
the sound driver will crash if you try to use this VCMD with !noVcmdFB set to
true!

This commit mentions #85.
@KungFuFurby KungFuFurby linked a pull request Sep 13, 2021 that will close this issue
16 tasks
@KungFuFurby KungFuFurby mentioned this issue May 17, 2022
4 tasks
@KungFuFurby KungFuFurby added the partially-resolved Something that partially resolves the issue (or part of the pull request itself) was merged. label Jun 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request partially-resolved Something that partially resolves the issue (or part of the pull request itself) was merged. spc-side Involves the SPC700 code.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant