Add some VCMD filtering options #85
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.
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...
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:Roughly speaking, it's equivalent to 2x+y = 4x-4z (left side uses a code pointer array, right side checks values individually), where...
Ties favor the code pointer array due to consuming less opcodes.
The text was updated successfully, but these errors were encountered: